Skip to content

chore: short-sha workflow to simple GITHUB_SHA refs (#18332) #16

chore: short-sha workflow to simple GITHUB_SHA refs (#18332)

chore: short-sha workflow to simple GITHUB_SHA refs (#18332) #16

name: Runtime - deploy localtest
on:
push:
branches:
- main
paths:
- src/Runtime/localtest/**
- .github/workflows/deploy-runtime-localtest.yaml
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
push-localtest:
name: Push localtest image to GHCR
runs-on: ubuntu-latest
environment: dev
defaults:
run:
working-directory: src/Runtime/localtest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Docker
uses: docker/setup-docker-action@e43656e248c0bd0647d3f5c195d116aacf6fcaf4 # v4.7.0
with:
daemon-config: |
{
"features": {
"containerd-snapshotter": true
}
}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set vars
id: vars
run: |
SHA="${GITHUB_SHA::10}"
GHCR_BASE="ghcr.io/altinn/altinn-studio"
echo "image=${GHCR_BASE}/runtime-localtest:${SHA}" >> $GITHUB_OUTPUT
- name: Login to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build image
run: docker build --platform linux/amd64,linux/arm64 -t ${{ steps.vars.outputs.image }} .
- name: Push image
run: docker push ${{ steps.vars.outputs.image }}