Skip to content

Commit

Permalink
feat: enable news deployments with GHA (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
raisedadead authored Aug 1, 2024
1 parent aaa1240 commit c94168e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 29 deletions.
48 changes: 21 additions & 27 deletions .github/workflows/deploy-eng.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
#
#
# WARNING: This workflow is NOT in use, see the Azure pipelines instead.
#
#

name: Eng - Build and Deploy

on:
workflow_dispatch:
# schedule:
# Here are the times for the cron:
#
# Sun, Mon, Tue, Thu, Fri : at 00:00, 03:00, 06:00, 09:00, 12:00, 15:00, 18:00 UTC
# Wed, Sat : at --:--, --:--, 06:00, 09:00, 12:00, 15:00, 18:00 UTC
#
# There is a 6 hour maintenance window on Wednesdays and Saturdays,
# and the crons are scheduled at 5 mins past the hour.
#
# - cron: '5 0,3,6,9,12,15,18 * * 0-2,4-5'
# - cron: '5 6,9,12,15,18 * * 3,6'
schedule:
# Here are the times for the cron:
#
# Sun, Mon, Tue, Thu, Fri : at 00:00, 03:00, 06:00, 09:00, 12:00, 15:00, 18:00, 21:00 UTC
# Wed, Sat : at --:--, --:--, 06:00, 09:00, 12:00, 15:00, 18:00, 21:00 UTC
#
# There is a 6 hour maintenance window on Wednesdays and Saturdays,
# and the crons are scheduled at 5 mins past the hour.
#
- cron: '5 0,3,6,9,12,15,18,21 * * 0-2,4-5'
- cron: '5 6,9,12,15,18,21 * * 3,6'

jobs:
build:
Expand Down Expand Up @@ -115,18 +109,18 @@ jobs:
--build-arg BUILD_LANGUAGE=${{ matrix.languages }} \
--file docker/Dockerfile
# - name: Install doctl
# uses: digitalocean/action-doctl@v2
# with:
# token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- 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: 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 }}/news-${{ matrix.languages }}:$tagname
# docker push registry.digitalocean.com/${{ secrets.DOCR_NAME }}/${{ matrix.site_tlds }}/news-${{ matrix.languages }}:latest
- name: Push image to DigitalOcean Container Registry
run: |
docker push registry.digitalocean.com/${{ secrets.DOCR_NAME }}/${{ matrix.site_tlds }}/news-${{ matrix.languages }}:$tagname
docker push registry.digitalocean.com/${{ secrets.DOCR_NAME }}/${{ matrix.site_tlds }}/news-${{ matrix.languages }}:latest
# - name: Clean up Self-hosted setup
# uses: colpal/actions-clean@36e6ca1abd35efe61cb60f912bd7837f67887c8a # tag=v1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Copyright (c) 2021 freeCodeCamp.org - Released under the
[3]: https://www.11ty.io/
[4]: https://github.com/TryGhost/eleventy-starter-ghost
[5]: https://contribute.freecodecamp.org/#/
[6]: https://dev.azure.com/freeCodeCamp-org/news/_apis/build/status/build-deploy-eng
[7]: https://dev.azure.com/freeCodeCamp-org/news/_build/latest?definitionId=31
[6]: https://github.com/freeCodeCamp/news/actions/workflows/deploy-eng.yml/badge.svg
[7]: https://github.com/freeCodeCamp/news/actions/workflows/deploy-eng.yml
[8]: https://github.com/freeCodeCamp/news/actions/workflows/deploy-i18n.yml/badge.svg
[9]: https://github.com/freeCodeCamp/news/actions/workflows/deploy-i18n.yml

0 comments on commit c94168e

Please sign in to comment.