aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-06-20 23:42:28 -0400
committerXe Iaso <me@xeiaso.net>2024-06-20 23:42:28 -0400
commit1c243a622be26654027fa4646ab0b27a4ebb00cd (patch)
tree3c08632be087945863d8f373993451aa92c24668 /.github
parent902efdfc306f714bffe2c1a48fbf329cac66489f (diff)
downloadxesite-1c243a622be26654027fa4646ab0b27a4ebb00cd.tar.xz
xesite-1c243a622be26654027fa4646ab0b27a4ebb00cd.zip
attempt to use earthly
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/earthly.yml55
-rw-r--r--.github/workflows/main.yml26
2 files changed, 55 insertions, 26 deletions
diff --git a/.github/workflows/earthly.yml b/.github/workflows/earthly.yml
new file mode 100644
index 0000000..a3c276a
--- /dev/null
+++ b/.github/workflows/earthly.yml
@@ -0,0 +1,55 @@
+name: Docker
+
+on:
+ push:
+ branches: [ "main" ]
+ # Publish semver tags as releases.
+ tags: [ 'v*.*.*' ]
+ pull_request:
+ branches: [ "main" ]
+env:
+ # Use docker.io for Docker Hub if empty
+ REGISTRY: ghcr.io
+ # github.repository as <account>/<repo>
+ IMAGE_NAME: ${{ github.repository }}
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: write
+ # This is used to complete the identity challenge
+ # with sigstore/fulcio when running outside of PRs.
+ id-token: write
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ - uses: earthly/actions-setup@v1
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ version: "latest" # or pin to an specific version, e.g. "0.8.1"
+ # Login against a Docker registry except on PR
+ # https://github.com/docker/login-action
+ - name: Log into registry ${{ env.REGISTRY }}
+ if: github.event_name != 'pull_request'
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
+ with:
+ registry: ${{ env.REGISTRY }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ # Extract metadata (tags, labels) for Docker
+ # https://github.com/docker/metadata-action
+ - name: Extract Docker metadata
+ id: meta
+ uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
+ with:
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
+ # Build and push Docker image with Buildx (don't push on PR)
+ # https://github.com/docker/build-push-action
+ - name: Build and push Docker image
+ id: steps.build-and-push
+ run: |
+ earthly --push +xesite
+ earthly --push +patreon-saasproxy \ No newline at end of file
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
deleted file mode 100644
index 6e8d14f..0000000
--- a/.github/workflows/main.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-on:
- push:
- branches:
- - main
- workflow_dispatch:
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - name: Install Nix
- uses: DeterminateSystems/nix-installer-action@v4
- with:
- extra-conf: |
- substituters = https://xe.cachix.org https://nix-community.cachix.org https://cuda-maintainers.cachix.org https://cache.floxdev.com?trusted=1 https://cache.garnix.io https://cache.nixos.org/
- trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= xe.cachix.org-1:kT/2G09KzMvQf64WrPBDcNWTKsA79h7+y2Fn2N7Xk2Y= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E= flox-store-public-0:8c/B+kjIaQ+BloCmNkRUKwaVPFWkriSAd0JJvuDu4F0= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
- - name: Run the Magic Nix Cache
- uses: DeterminateSystems/magic-nix-cache-action@v2
- - uses: actions/setup-go@v4
- - name: Make and deploy Xesite
- run: |
- nix develop -c "./scripts/fabricate-generation"
- env:
- TAILSCALE_CLIENT_ID: ${{ secrets.TAILSCALE_CLIENT_ID }}
- TAILSCALE_CLIENT_SECRET: ${{ secrets.TAILSCALE_CLIENT_SECRET }}