59 lines
No EOL
1.7 KiB
YAML
59 lines
No EOL
1.7 KiB
YAML
name: Test action
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
registry: git.amarth.cloud
|
|
owner: chris
|
|
image: default
|
|
tag: latest
|
|
|
|
jobs:
|
|
hello:
|
|
name: Print hello world
|
|
runs-on: default
|
|
steps:
|
|
- name: Pull dependencies
|
|
run: |
|
|
git clone https://${{ env.registry }}/${{ env.owner }}/sneeuwvlok.git .
|
|
|
|
- name: Prepare podman
|
|
run: |
|
|
# configure container policy to accept insecure registry
|
|
nix-env -iA nixpkgs.podman
|
|
|
|
# configure container policy to accept insecure registry
|
|
mkdir -p ~/.config/containers
|
|
echo '{ "default": [ {"type":"insecureAcceptAnything"} ] }' > ~/.config/containers/policy.json
|
|
|
|
# ensure all required directories exist with proper permissions
|
|
mkdir -p /tmp/podman /var/tmp ~/.local/share/containers
|
|
chmod 755 /tmp/podman /var/tmp || true
|
|
|
|
# set multiple environment variables for skopeo temporary directories
|
|
export TMPDIR=/tmp/podman
|
|
export TMP=/tmp/podman
|
|
export TEMP=/tmp/podman
|
|
export XDG_RUNTIME_DIR=/tmp/podman
|
|
|
|
- name: Log into registry
|
|
run: |
|
|
podman login --username "${{ forge.actor }}" --password "${{ forge.token }}" ${{ env.registry }}
|
|
|
|
- name: Build image
|
|
run: >-
|
|
podman build
|
|
--privileged
|
|
-t ${{ env.registry }}/${{ env.owner }}/${{ env.image }}:${{ env.tag }}
|
|
-f Dockerfile.default
|
|
modules/nixos/services/development/forgejo
|
|
env:
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
- name: Push image
|
|
run: |
|
|
podman push ${{ env.registry }}/${{ env.owner }}/${{ env.image }}:${{ env.tag }} |