Skip to content

Commit

Permalink
Nix in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Jul 25, 2024
1 parent 688062a commit 2998f51
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 175 deletions.
45 changes: 12 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,27 @@ on:
pull_request:

jobs:
test:
name: Test/Nix
runs-on: ubuntu-24.04
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- run: nix build
push_to_pypi:
name: Build/Publish Docker
runs-on: ubuntu-20.04
name: Build
needs: [test]
runs-on: ubuntu-24.04
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Export Repo URL
run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV
- name: Export Branch Name
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
uses: actions/checkout@v3
- name: Set default for env.NEW_TAG
run: echo "NEW_TAG=NO_NEW_TAG" >> $GITHUB_ENV
- name: Write Hash
run: |
echo "GIT_COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Build Image
run: |
docker build --target runner -t aucohl/fault:latest .
- name: Check for new version
if: ${{ env.BRANCH_NAME == 'main' }}
run: |
python3 .github/scripts/generate_tag.py
- name: Log in to the Container registry
if: ${{ env.BRANCH_NAME == 'main' }}
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GHCR (Commit)
if: ${{ env.BRANCH_NAME == 'main' }}
run: |
docker image tag aucohl/fault:latest ghcr.io/aucohl/fault:${{ env.GIT_COMMIT_HASH }}
docker push ghcr.io/aucohl/fault:${{ env.GIT_COMMIT_HASH }}
- name: Push to GHCR (Tag)
if: ${{ env.NEW_TAG != 'NO_NEW_TAG' }}
run: |
docker image tag aucohl/fault:latest ghcr.io/aucohl/fault:latest
docker image tag aucohl/fault:latest ghcr.io/aucohl/fault:$NEW_TAG
docker push ghcr.io/aucohl/fault:$NEW_TAG
docker push ghcr.io/aucohl/fault:latest
# Last, because this triggers the AppImage CI
- name: Tag Commit
if: ${{ env.NEW_TAG != 'NO_NEW_TAG' }}
uses: tvdias/github-tagger@v0.0.1
Expand Down
106 changes: 0 additions & 106 deletions Dockerfile

This file was deleted.

36 changes: 0 additions & 36 deletions flow_s.sh

This file was deleted.

0 comments on commit 2998f51

Please sign in to comment.