mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-16 13:00:49 -04:00
build: add workflow to publish images to DOCR (#54025)
This commit is contained in:
committed by
GitHub
parent
cb4061c250
commit
7bb3381a46
43
.github/workflows/build-images.yml
vendored
Normal file
43
.github/workflows/build-images.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: CI - Build Images
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build (Image)
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
apps: [api]
|
||||
site_tlds: [dev]
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Files
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Create a tagname
|
||||
id: tagname
|
||||
run: |
|
||||
echo "tagname=$(git rev-parse --short HEAD)-$(date +%Y%m%d)-$(date +%H%M)" >> $GITHUB_ENV
|
||||
|
||||
- name: Build & Tag Image
|
||||
run: |
|
||||
docker build \
|
||||
--tag registry.digitalocean.com/${{ secrets.DOCR_NAME }}/${{ matrix.site_tlds }}/learn-${{ matrix.apps }}:$tagname \
|
||||
--tag registry.digitalocean.com/${{ secrets.DOCR_NAME }}/${{ matrix.site_tlds }}/learn-${{ matrix.apps }}:latest \
|
||||
--file docker/${{ matrix.apps }}/Dockerfile .
|
||||
|
||||
- name: Install doctl
|
||||
uses: digitalocean/action-doctl@v2
|
||||
with:
|
||||
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
||||
|
||||
- name: Log in to DigitalOcean Container Registry with short-lived credentials
|
||||
run: doctl registry login --expiry-seconds 1200
|
||||
|
||||
- name: Push image to DigitalOcean Container Registry
|
||||
run: |
|
||||
docker push registry.digitalocean.com/${{ secrets.DOCR_NAME }}/${{ matrix.site_tlds }}/learn-${{ matrix.apps }}:$tagname
|
||||
docker push registry.digitalocean.com/${{ secrets.DOCR_NAME }}/${{ matrix.site_tlds }}/learn-${{ matrix.apps }}:latest
|
||||
25
.github/workflows/e2e-with-new-api.yml
vendored
25
.github/workflows/e2e-with-new-api.yml
vendored
@@ -71,8 +71,8 @@ jobs:
|
||||
name: webpack-stats
|
||||
path: client/public/stats.json
|
||||
|
||||
build-api:
|
||||
name: Build Api (Container)
|
||||
build-new-api:
|
||||
name: Build New Api (Container)
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -90,27 +90,8 @@ jobs:
|
||||
-t fcc-api \
|
||||
-f docker/api/Dockerfile .
|
||||
|
||||
build-new-api:
|
||||
name: Build New Api (Container)
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Files
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
|
||||
- name: Create Image
|
||||
run: |
|
||||
docker build \
|
||||
-t fcc-new-api \
|
||||
-f docker/new-api/Dockerfile .
|
||||
|
||||
- name: Save Image
|
||||
run: docker save fcc-new-api > api-artifact.tar
|
||||
run: docker save fcc-api > api-artifact.tar
|
||||
|
||||
- name: Upload Api Artifact
|
||||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
|
||||
|
||||
@@ -50,7 +50,6 @@ jobs:
|
||||
--build-arg SHOW_NEW_CURRICULUM=false \
|
||||
--build-arg GROWTHBOOK_URI=api_URI_from_Growthbook_dashboard \
|
||||
--build-arg FREECODECAMP_NODE_ENV=development \
|
||||
-t fcc-client \
|
||||
-f docker/web/Dockerfile .
|
||||
|
||||
build-api:
|
||||
@@ -69,8 +68,7 @@ jobs:
|
||||
- name: Create Image
|
||||
run: |
|
||||
docker build \
|
||||
-t fcc-api \
|
||||
-f docker/api/Dockerfile .
|
||||
-f docker/api-server/Dockerfile .
|
||||
|
||||
build-new-api:
|
||||
name: Build New Api (Container)
|
||||
@@ -88,5 +86,4 @@ jobs:
|
||||
- name: Create Image
|
||||
run: |
|
||||
docker build \
|
||||
-t fcc-new-api \
|
||||
-f docker/new-api/Dockerfile .
|
||||
-f docker/api/Dockerfile .
|
||||
|
||||
Reference in New Issue
Block a user