This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
fix: missing perms for GITHUB_TOKEN #8
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: 🚀 Build/Release docker api-server | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/api-server.yaml' | |
- 'api-server/**' | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/api-server.yaml' | |
- 'api-server/**' | |
tags: | |
- 'api-server_v[0-9]+.[0-9]+.[0-9]+' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
docker-build: | |
permissions: | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: docker login | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: set up buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ github.repository_owner }}/api-server | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=match,pattern=api-server_(v\d+.\d+.\d+) | |
type=raw,value={{branch}}-{{sha}}-{{date 'X'}},enable={{is_default_branch}} | |
type=ref,event=pr | |
- name: build docker images | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:api-server" | |
file: Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |