Enabling Docker package building (trying at least) #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create and Push Docker Image | |
on: | |
push: | |
branches: | |
- release/firehose | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
sei-images: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Display the version of go that we have installed | |
run: go version | |
- name: Compile the binary | |
run: | | |
make install | |
mkdir /root/build | |
cp "`go env GOPATH`/bin/seid" /root/build/seid | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate docker tags/labels from github build context | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=tag | |
type=sha,prefix=,enable=true | |
type=raw,enable=${{ github.ref == 'refs/heads/release/firehose' }},value=develop | |
flavor: | | |
latest=${{ startsWith(github.ref, 'refs/tags/') }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
file: Dockerfile.sf | |
context: /root/build | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |