Skip to content

ci: try adding permissions #20

ci: try adding permissions

ci: try adding permissions #20

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4.1.1
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3.0.0
with:
buildkitd-flags: --debug
- name: Setup Go environment
uses: actions/setup-go@v5.0.0
- name: Go build
run: go build -v ./...
- name: Go test
run: go test -v ./...
- name: Cache Docker layers
uses: actions/cache@v4.0.0
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Docker Login
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v5.1.0
with:
context: .
file: ./Dockerfile
tags: |
ghcr.io/${{ github.repository }}:${{ github.run_number }}
ghcr.io/${{ github.repository }}:latest
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache