Skip to content

Allow admins to access machines independent of allocation state. #113

Allow admins to access machines independent of allocation state.

Allow admins to access machines independent of allocation state. #113

Workflow file for this run

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.22
uses: actions/setup-go@v5
with:
go-version: '1.22.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'