[#] flake: update deps #72
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: Build docker containers | |
on: | |
push: | |
branches: [master, develop] | |
tags: | |
- v*.*.* | |
jobs: | |
pack-image: | |
runs-on: ubuntu-22.04 | |
env: | |
IMAGE_NAME: ${{ github.repository }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go v1.x | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
cache: true | |
- name: Build (amd64) | |
env: | |
GOARCH: amd64 | |
GOOS: linux | |
run: go build -ldflags "-X 'github.com/nextdotid/proof_server/common.Environment=production' -X 'github.com/nextdotid/proof_server/common.Revision=${{ github.sha }}' -X 'github.com/nextdotid/proof_server/common.BuildTime=$(date +%s)'" -o server_amd64 ./cmd/server | |
- name: Build (arm64) | |
env: | |
GOARCH: arm64 | |
GOOS: linux | |
run: go build -ldflags "-X 'github.com/nextdotid/proof_server/common.Environment=production' -X 'github.com/nextdotid/proof_server/common.Revision=${{ github.sha }}' -X 'github.com/nextdotid/proof_server/common.BuildTime=$(date +%s)'" -o server_arm64 ./cmd/server | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Setup Docker BuildX | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
- name: Login in to Docker registry | |
uses: docker/login-action@v2 | |
if: github.event_name != 'pull_request' | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login in to Github registry | |
uses: docker/login-action@v2 | |
if: github.event_name != 'pull_request' | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
docker.io/${{ env.IMAGE_NAME }} | |
ghcr.io/${{ env.IMAGE_NAME }} | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: '.' | |
push: ${{ github.event_name != 'pull_request' }} | |
file: ./.github/workflows/docker/Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 |