fix static area in Dockerfile #9
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- "v*" # triggers only if push new tag version, like `0.8.4` or else | |
permissions: write-all | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.21 | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
# https://github.com/orgs/community/discussions/26686 | |
- name: Branch name | |
id: branch_name | |
run: | | |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/} | |
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} | |
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} | |
# - name: Echo | |
# run: | | |
# echo ${{ steps.branch_name.outputs.SOURCE_NAME }} | |
# echo ${{ steps.branch_name.outputs.SOURCE_BRANCH }} | |
# echo ${{ steps.branch_name.outputs.SOURCE_TAG }} | |
- name: Build | |
env: | |
GOPATH: /home/runner/go | |
run: | | |
make build_all | |
tar cvfz databookkeeping.tar.gz srv* | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build image | |
run: | | |
make golib | |
# use multi-stage build to run on mac ARM: | |
# https://stackoverflow.com/questions/71000707/docker-get-started-warning-the-requested-images-platform-linux-arm64-v8-doe | |
# https://github.com/docker/for-mac/issues/6356 | |
# https://docs.docker.com/build/ci/github-actions/multi-platform/ | |
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/chesscomputing/databookkeeping:${{ steps.branch_name.outputs.SOURCE_TAG }} . | |
- name: Login to ghcr.io registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish image | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
ghcr.io/chesscomputing/databookkeeping:latest | |
ghcr.io/chesscomputing/databookkeeping:${{ steps.branch_name.outputs.SOURCE_TAG }} | |
- name: "✏️ Generate release changelog" | |
uses: heinrichreimer/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload binaries | |
id: upload_binaries | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./databookkeeping.tar.gz | |
asset_name: databookkeeping.tar.gz | |
asset_content_type: application/octet-stream | |