style: move push action to new dir so github and gitea can share it
Some checks failed
Check / check (push) Failing after 0s
Some checks failed
Check / check (push) Failing after 0s
This commit is contained in:
@ -12,22 +12,12 @@ jobs:
|
||||
name: check
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
contains(gitea.event.head_commit.message, 'bump:') == false &&
|
||||
contains(gitea.event.head_commit.message, 'Merge pull request') == false
|
||||
contains(github.event.head_commit.message, 'bump:') == false &&
|
||||
contains(github.event.head_commit.message, 'Merge pull request') == false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.actions/init
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- name: Use Cachix
|
||||
uses: cachix/cachix-action@v16
|
||||
with:
|
||||
name: trevstack
|
||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- name: Check
|
||||
run: nix flake check
|
||||
- run: nix flake check
|
||||
|
@ -9,43 +9,23 @@ jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.actions/init
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- name: Use Cachix
|
||||
uses: cachix/cachix-action@v16
|
||||
with:
|
||||
name: trevstack
|
||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- name: Check
|
||||
run: nix flake check
|
||||
- run: nix flake check
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: check
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.actions/init
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- name: Use Cachix
|
||||
uses: cachix/cachix-action@v16
|
||||
with:
|
||||
name: trevstack
|
||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- name: Build
|
||||
run: >
|
||||
- run: >
|
||||
nix build
|
||||
.#trevstack-linux-amd64
|
||||
.#trevstack-linux-arm64
|
||||
@ -54,52 +34,35 @@ jobs:
|
||||
.#trevstack-darwin-amd64
|
||||
.#trevstack-darwin-arm64
|
||||
|
||||
- name: Release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
- uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
files: |-
|
||||
result*/bin/*
|
||||
|
||||
# https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
|
||||
package:
|
||||
runs-on: ubuntu-latest
|
||||
needs: release # Wait for binary cache to propagate
|
||||
needs: release
|
||||
steps:
|
||||
- name: Get domain
|
||||
id: get_domain
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.actions/init
|
||||
with:
|
||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ github.server_url }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build & load images
|
||||
run: |
|
||||
DOMAIN=$(basename ${{ gitea.server_url }})
|
||||
echo $DOMAIN
|
||||
echo "domain=$DOMAIN" >> $GITHUB_OUTPUT
|
||||
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: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
- name: Push images
|
||||
uses: ./.actions/push
|
||||
with:
|
||||
# list of Docker images to use as base name for tags
|
||||
images: |
|
||||
${{ steps.get_domain.outputs.domain }}/${{ gitea.repository }}
|
||||
# generate Docker tags based on the following events/attributes
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
|
||||
- name: Login to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ gitea.server_url }}
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.PAT }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
server_url: ${{ github.server_url }}
|
||||
repository: ${{ github.repository }}
|
||||
tag: ${{ github.ref_name }}
|
||||
|
@ -9,33 +9,21 @@ jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.actions/init
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: Use Cachix
|
||||
uses: cachix/cachix-action@v16
|
||||
with:
|
||||
name: trevstack
|
||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
# 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"
|
||||
git checkout -B update
|
||||
|
||||
- name: Update
|
||||
run: nix run .#update
|
||||
- run: nix run .#update
|
||||
|
||||
- name: Create Pull Request
|
||||
- name: Create pull request
|
||||
env:
|
||||
PAT: ${{ secrets.PAT }}
|
||||
run: |
|
||||
|
Reference in New Issue
Block a user