Skip to content

Commit

Permalink
Merge pull request #811 from CodeForAfrica/fix/roboshield_prod_build
Browse files Browse the repository at this point in the history
@/roboshield Fix PROD workflow
  • Loading branch information
kilemensi authored Aug 1, 2024
2 parents 5a748a6 + 0c70619 commit 3074b7e
Show file tree
Hide file tree
Showing 15 changed files with 117 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/charterafrica-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/charterafrica-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/climatemappedafrica-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Cloning repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Cloning repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeforafrica-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeforafrica-deploy-review-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
if: github.event_name == 'pull_request' && github.event.action != 'closed'
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot_lint_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pesayetu-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Cloning repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Checkout
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/roboshield-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,33 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Cloning repo
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: ${{ runner.os }}-buildx-${{ github.sha }}
path: /tmp/.buildx-cache
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKER_HUB_USERNAME }}

- name: Build Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
build-args: |
MONGO_URL=${{ secrets.ROBOSHIELD_MONGO_URL }}
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/roboshield-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: RoboShield | Deploy | PROD
on:
push:
branches: [main]
paths:
- "apps/roboshield/**"
- "Dockerfile"
- ".github/workflows/roboshield-deploy-prod.yml"

concurrency:
group: "${{ github.workflow }} @ ${{ github.ref }}"
Expand All @@ -27,11 +23,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Cloning repo
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
Expand All @@ -47,24 +43,28 @@ jobs:
file-name: "${{ env.VERSION_FILE_NAME }}"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
if: steps.version-check.outputs.changed == 'true'
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
if: steps.version-check.outputs.changed == 'true'
uses: actions/cache@v4
with:
key: ${{ runner.os }}-buildx-${{ github.sha }}
path: /tmp/.buildx-cache
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2
if: steps.version-check.outputs.changed == 'true'
uses: docker/login-action@v3
with:
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKER_HUB_USERNAME }}

- name: Build Docker image
uses: docker/build-push-action@v3
if: steps.version-check.outputs.changed == 'true'
uses: docker/build-push-action@v5
with:
build-args: |
MONGO_URL=${{ secrets.ROBOSHIELD_MONGO_URL }}
Expand All @@ -87,11 +87,13 @@ jobs:
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
if: steps.version-check.outputs.changed == 'true'
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Push to Dokku
if: steps.version-check.outputs.changed == 'true'
uses: dokku/[email protected]
with:
git_remote_url: ${{ env.DOKKU_REMOTE_URL }}/${{ env.APP_NAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vpnmanager-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.14]
node-version: [20.16]
os: [ubuntu-latest]
steps:
- name: Checkout
Expand Down
Loading

0 comments on commit 3074b7e

Please sign in to comment.