fix: checkout first
Some checks failed
Check / check (push) Failing after 0s

This commit is contained in:
trev 2025-05-17 02:57:37 -04:00
parent 1062595d7f
commit 7619be6d11
4 changed files with 20 additions and 18 deletions

View File

@ -1,16 +1,13 @@
name: "Initialize"
name: "initialize"
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
- name: install nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Use Cachix
- name: use cachix
uses: cachix/cachix-action@v16
with:
name: trevstack

View File

@ -15,6 +15,7 @@ jobs:
contains(github.event.head_commit.message, 'bump:') == false &&
contains(github.event.head_commit.message, 'Merge pull request') == false
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/init
- name: Check

View File

@ -13,18 +13,20 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/init
- name: Check
- name: check
run: nix flake check
release:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/init
- name: Build
- name: build
run: >
nix build
.#trevstack-linux-amd64
@ -34,7 +36,7 @@ jobs:
.#trevstack-darwin-amd64
.#trevstack-darwin-arm64
- name: Release
- name: release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
@ -45,9 +47,10 @@ jobs:
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/init
- name: Set env
- name: set env
run: |
TAG=${{ github.ref_name }}
VERSION=${TAG#v}
@ -56,20 +59,20 @@ jobs:
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "REGISTRY=${REGISTRY}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
- name: login to github container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Load Images
- name: build & load images
run: |
nix build .#trevstack-linux-amd64-image && ./result | docker load
nix build .#trevstack-linux-arm64-image && ./result | docker load
nix build .#trevstack-linux-arm-image && ./result | docker load
- name: Push Images
- name: push images
run: |
docker image tag trevstack:$VERSION-amd64 $REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64
docker push $REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64
@ -80,7 +83,7 @@ jobs:
docker image tag trevstack:$VERSION-arm $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm
docker push $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm
- name: Push Manifest
- name: push manifest
run: |
docker manifest create $REGISTRY/$GITHUB_REPOSITORY:$VERSION \
$REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64 \

View File

@ -13,18 +13,19 @@ jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/init
# https://github.com/actions/checkout/issues/13
- name: Set Git Config
- name: set git config
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Update
- name: update
run: nix run .#update
- name: Create Pull Request
- name: create pull request
id: cpr
uses: peter-evans/create-pull-request@v7
with:
@ -32,7 +33,7 @@ jobs:
title: update
body: automatic update
- name: Enable Automerge
- name: enable automerge
run: gh pr merge --merge --auto "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.PAT }}