Skip to content

Update workflow actions #16

Update workflow actions

Update workflow actions #16

Workflow file for this run

name: Publish Docker image
on:
push:
tags:
- v*
env:
IMAGE_NAME: bitmapist-server
jobs:
test:
name: Test suite
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- uses: actions/checkout@v4
- name: Get dependencies
run: go mod download
- name: Install redis
run: sudo apt-get install -y -qq redis-server
- name: Run tests
run: go test -v -race ./...
push:
needs: test
name: Build and push Docker image
runs-on: ubuntu-latest
if: github.event_name == 'push'
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

Check failure on line 33 in .github/workflows/docker.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker.yml

Invalid workflow file

You have an error in your yaml syntax on line 33
- id: gen-tag
run: |
IMAGE_TAG=${GITHUB_REF##*/}
echo IMAGE_TAG | tee ci-version.txt
echo "tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_PACKAGES_TOKEN }}
- uses: docker/build-push-action@v5
with:
push: true
platforms: |
linux/arm64
linux/amd64
tags: |
ghcr.io/doist/bitmapist-server:${{ steps.gen-tag.outputs.tag }}
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=6,force-compression=true
cache-from: type=gha
cache-to: type=gha,mode=max