-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1afc3eb
commit 5ef3d86
Showing
2 changed files
with
33 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,54 @@ | ||
name: CI | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build: | ||
runs-on: x86_64-linux | ||
|
||
outputs: | ||
image_name: ${{ steps.image_info.outputs.image_name }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: cachix/cachix-action@v15 | ||
with: | ||
name: nammayatri | ||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | ||
skipPush: true | ||
|
||
- name: Build all flake outputs | ||
run: om ci | ||
|
||
- name: Docker tasks | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
nix build .#dockerImage -o docker-image.tgz | ||
echo "image_name=$(nix eval --raw .#dockerImage.imageName):$(nix eval --raw .#dockerImage.imageTag)" >> $GITHUB_OUTPUT | ||
- name: Upload Docker image tarball | ||
if: github.ref == 'refs/heads/main' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docker-image | ||
path: docker-image.tgz | ||
|
||
push-docker: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: Download Docker image tarball | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: docker-image | ||
- name: Load and push Docker image | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo "$GITHUB_TOKEN" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin | ||
docker load < docker-image.tgz | ||
docker push ${{ needs.build.outputs.image_name }} | ||
docker logout ghcr.io |
This file was deleted.
Oops, something went wrong.