linkleaner/.github/workflows/release.yml

48 lines
1.5 KiB
YAML

name: Build and deploy
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
concurrency:
group: ${{ github.workflow }}
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Set up flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@de22e16c4711fca50c816cc9081563429d1cf563 # v10
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-conf: |
trusted-substituters = https://cache.nixos.org https://nix-community.cachix.org https://cache.garnix.io
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
- name: Build and load container image
shell: bash
run: |
nix build .#container
docker load < result
- name: Publish image and deploy
shell: bash
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
run: |
flyctl auth docker
flyctl deploy
- name: Trigger package bump in dotfiles repo
run: gh api repos/msfjarvis/dotfiles/dispatches --field event_type="package-bump" --field client_payload[package_name]="linkleaner"
env:
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }}