oliverdavies.uk/.github/workflows/ci.yml

54 lines
1.2 KiB
YAML
Raw Normal View History

2021-07-27 08:00:00 +00:00
name: CI
on:
push:
branches:
- main
2021-08-17 19:41:39 +00:00
paths-ignore:
2022-09-29 21:49:41 +00:00
- "README.md"
2021-08-17 19:43:06 +00:00
schedule:
2022-09-29 21:49:41 +00:00
- cron: "0 12 15 * *"
2021-08-17 19:43:06 +00:00
workflow_dispatch:
jobs:
ci: re-add deploy job diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4202a6..c0598b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ env: DOCKER_TAG: ${{ github.sha }} jobs: - build-and-push-images: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 @@ -33,4 +33,22 @@ jobs: - run: | just push-images ${{ github.sha }} + deploy: + runs-on: ubuntu-latest + needs: + - build + steps: + - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76 # 1.5.0 + + - name: Add the deployment SSH key + uses: shimataro/ssh-key-action@3c9b0fc6f2d223b8450b02a0445f526350fc73e0 # 2.3.1 + with: + key: ${{ secrets.SSH_PRIVATE_KEY }} + name: id_rsa + known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} + + - run: | + just deploy ${{ github.sha }} + # vim: sw=2 ts=2 diff --git a/justfile b/justfile index e4916d1..5afe23d 100644 --- a/justfile +++ b/justfile @@ -12,11 +12,11 @@ create-daily: touch "${filepath}/${filename}" eval "${EDITOR}" "${filepath}/${filename}" -deploy: +deploy sha: rm -fr _deploy docker container rm oliverdavies.uk-build || true - docker image pull ghcr.io/opdavies/oliverdavies.uk-build + docker image pull ghcr.io/opdavies/oliverdavies.uk-build:{{ sha }} docker container run --entrypoint sh --name oliverdavies.uk-build ghcr.io/opdavies/oliverdavies.uk-build docker container cp oliverdavies.uk-build:/app/ _deploy
2022-09-29 22:29:58 +00:00
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
2023-07-18 12:27:18 +00:00
- uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac # v22
with:
nix_path: nixpkgs=channel:nixos-unstable
2023-07-18 12:37:54 +00:00
- run: |
2023-10-07 00:30:42 +00:00
./run ci:build
2023-07-18 12:37:54 +00:00
2023-07-18 13:01:48 +00:00
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
2021-07-15 23:47:35 +00:00
with:
2023-07-18 13:01:48 +00:00
name: dist
path: dist
ci: re-add deploy job diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4202a6..c0598b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ env: DOCKER_TAG: ${{ github.sha }} jobs: - build-and-push-images: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 @@ -33,4 +33,22 @@ jobs: - run: | just push-images ${{ github.sha }} + deploy: + runs-on: ubuntu-latest + needs: + - build + steps: + - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76 # 1.5.0 + + - name: Add the deployment SSH key + uses: shimataro/ssh-key-action@3c9b0fc6f2d223b8450b02a0445f526350fc73e0 # 2.3.1 + with: + key: ${{ secrets.SSH_PRIVATE_KEY }} + name: id_rsa + known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} + + - run: | + just deploy ${{ github.sha }} + # vim: sw=2 ts=2 diff --git a/justfile b/justfile index e4916d1..5afe23d 100644 --- a/justfile +++ b/justfile @@ -12,11 +12,11 @@ create-daily: touch "${filepath}/${filename}" eval "${EDITOR}" "${filepath}/${filename}" -deploy: +deploy sha: rm -fr _deploy docker container rm oliverdavies.uk-build || true - docker image pull ghcr.io/opdavies/oliverdavies.uk-build + docker image pull ghcr.io/opdavies/oliverdavies.uk-build:{{ sha }} docker container run --entrypoint sh --name oliverdavies.uk-build ghcr.io/opdavies/oliverdavies.uk-build docker container cp oliverdavies.uk-build:/app/ _deploy
2022-09-29 22:29:58 +00:00
deploy:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Add the deployment SSH key
uses: shimataro/ssh-key-action@3c9b0fc6f2d223b8450b02a0445f526350fc73e0 # 2.3.1
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
name: id_rsa
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
2023-07-18 13:01:48 +00:00
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: dist
path: dist
ci: re-add deploy job diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4202a6..c0598b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ env: DOCKER_TAG: ${{ github.sha }} jobs: - build-and-push-images: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 @@ -33,4 +33,22 @@ jobs: - run: | just push-images ${{ github.sha }} + deploy: + runs-on: ubuntu-latest + needs: + - build + steps: + - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76 # 1.5.0 + + - name: Add the deployment SSH key + uses: shimataro/ssh-key-action@3c9b0fc6f2d223b8450b02a0445f526350fc73e0 # 2.3.1 + with: + key: ${{ secrets.SSH_PRIVATE_KEY }} + name: id_rsa + known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} + + - run: | + just deploy ${{ github.sha }} + # vim: sw=2 ts=2 diff --git a/justfile b/justfile index e4916d1..5afe23d 100644 --- a/justfile +++ b/justfile @@ -12,11 +12,11 @@ create-daily: touch "${filepath}/${filename}" eval "${EDITOR}" "${filepath}/${filename}" -deploy: +deploy sha: rm -fr _deploy docker container rm oliverdavies.uk-build || true - docker image pull ghcr.io/opdavies/oliverdavies.uk-build + docker image pull ghcr.io/opdavies/oliverdavies.uk-build:{{ sha }} docker container run --entrypoint sh --name oliverdavies.uk-build ghcr.io/opdavies/oliverdavies.uk-build docker container cp oliverdavies.uk-build:/app/ _deploy
2022-09-29 22:29:58 +00:00
- run: |
2023-10-07 00:30:42 +00:00
./run ci:deploy ${{ github.sha }}
ci: re-add deploy job diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4202a6..c0598b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ env: DOCKER_TAG: ${{ github.sha }} jobs: - build-and-push-images: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 @@ -33,4 +33,22 @@ jobs: - run: | just push-images ${{ github.sha }} + deploy: + runs-on: ubuntu-latest + needs: + - build + steps: + - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76 # 1.5.0 + + - name: Add the deployment SSH key + uses: shimataro/ssh-key-action@3c9b0fc6f2d223b8450b02a0445f526350fc73e0 # 2.3.1 + with: + key: ${{ secrets.SSH_PRIVATE_KEY }} + name: id_rsa + known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} + + - run: | + just deploy ${{ github.sha }} + # vim: sw=2 ts=2 diff --git a/justfile b/justfile index e4916d1..5afe23d 100644 --- a/justfile +++ b/justfile @@ -12,11 +12,11 @@ create-daily: touch "${filepath}/${filename}" eval "${EDITOR}" "${filepath}/${filename}" -deploy: +deploy sha: rm -fr _deploy docker container rm oliverdavies.uk-build || true - docker image pull ghcr.io/opdavies/oliverdavies.uk-build + docker image pull ghcr.io/opdavies/oliverdavies.uk-build:{{ sha }} docker container run --entrypoint sh --name oliverdavies.uk-build ghcr.io/opdavies/oliverdavies.uk-build docker container cp oliverdavies.uk-build:/app/ _deploy
2022-09-29 22:29:58 +00:00
# vim: sw=2 ts=2