Skip to content

v1.0.0-rc4

v1.0.0-rc4 #264

Workflow file for this run

on:
push:
branches:
- main
release:
types:
- created
jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:16-3.4-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Set up Nix Caching using GitHub Actions Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Check health of Nix flake input
uses: DeterminateSystems/flake-checker-action@main
- name: Run project checks
run: nix develop -c check_project
- name: Set container release tag
run: |
if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
echo -n "${GITHUB_REF#refs/tags/}" > ./container_release
else
echo -n "main-$(git rev-parse --short HEAD)" > ./container_release
fi
# Export value to Github variables
echo "TAG=$(cat ./container_release)" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | skopeo login ghcr.io --username ${{ github.actor }} --password-stdin
- name: Build and push Docker image
run: |
nix build .#dockerImage
./result | gzip --fast | \
skopeo copy \
docker-archive:/dev/stdin \
docker://ghcr.io/safehavenmaps/safehaven:$TAG