Skip to content

Push preview tag on main #44

Push preview tag on main

Push preview tag on main #44

Workflow file for this run

name: Publish API
on:
push:
branches:
- main
tags:
- '[0-9]+.[0-9]+.*'
permissions: { }
jobs:
publish-docker-image:
name: Publish docker image
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
packages: write
id-token: write
attestations: write
outputs:
digest: ${{ steps.docker.outputs.digest }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build, tag & push docker image
uses: AplinkosMinisterija/reusable-workflows/.github/actions/docker-build-tag-push@main
id: docker
with:
docker-image: ghcr.io/govlt/national-boundaries-api
environment: ${{ github.event_name == 'push' && 'preview' || (contains(github.ref, 'pre') && 'preview' || 'stable') }}
no-cache: true
push: true
cache-from: ''
cache-to: ''
- name: Generate docker image attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/govlt/national-boundaries-api
subject-digest: ${{ steps.docker.outputs.digest }}
push-to-registry: true
- name: Extract files from Docker image
uses: shrink/actions-docker-extract@v3
id: extract
with:
image: ghcr.io/govlt/national-boundaries-api@${{ steps.docker.outputs.digest }}
path: /opt/app/.
destination: app
- name: Upload boundaries.sqlite artifact
uses: actions/upload-artifact@v4
with:
name: boundaries.sqlite
path: app/boundaries.sqlite
if-no-files-found: error
- name: Upload data-source-checksums.txt artifact
uses: actions/upload-artifact@v4
with:
name: data-source-checksums.txt
path: app/data-source-checksums.txt
if-no-files-found: error
- name: Upload artifacts to GitHub release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
make_latest: ${{ contains(github.ref, 'pre') && 'false' || 'true' }}
files: |
app/boundaries.sqlite
app/data-source-checksums.txt