Migrate to jwt-go v5 #130
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 image from pull request | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Figure out if running fork PR | |
id: fork | |
run: '["${{ secrets.DOCKER_REGISTRY_TOKEN }}" == ""] && echo "::set-output name=is_fork_pr::true" || echo "::set-output name=is_fork_pr::false"' | |
- name: Docker Login | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.DOCKER_REGISTRY }} | |
username: ${{ secrets.DOCKER_REGISTRY_USER }} | |
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
if: steps.fork.outputs.is_fork_pr == 'false' | |
- name: Set up Go 1.23 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23.x' | |
- name: Lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
args: -p bugs -p unused | |
- name: Build Docker image | |
run: | | |
export GITHUB_TAG_NAME=${GITHUB_HEAD_REF##*/} | |
docker build -f Dockerfile -t ghcr.io/metal-stack/metal-console:pr-${GITHUB_TAG_NAME} . | |
- name: Push Docker image | |
run: | | |
export GITHUB_TAG_NAME=${GITHUB_HEAD_REF##*/} | |
# pull request images are prefixed with 'pr' to prevent them from overriding released images | |
docker push ghcr.io/metal-stack/metal-console:pr-${GITHUB_TAG_NAME} | |
if: steps.fork.outputs.is_fork_pr == 'false' |