-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove digital ocean container registry (#61)
use ghcr.io instead
- Loading branch information
Showing
1 changed file
with
3 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,35 +41,22 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
- name: Install doctl | ||
uses: digitalocean/action-doctl@v2 | ||
with: | ||
token: ${{ secrets.DO_ACCESS_TOKEN }} | ||
- name: Log in to DigitalOcean Container Registry with short-lived credentials | ||
run: doctl registry login --expiry-seconds 1200 | ||
- name: Log in to GitHub Container Registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
- id: get_image_tag | ||
run: | | ||
echo "GITHUB_SHA_SHORT=$(echo ${GITHUB_SHA::8})" >> $GITHUB_ENV | ||
echo "registry.digitalocean.com/kemkas/kemkas-fe:${GITHUB_SHA::8}" | ||
echo "ghcr.io/${{ github.repository_owner }}/kemkas-frontend:${GITHUB_SHA::8}" | ||
echo "image_tag=registry.digitalocean.com/kemkas/kemkas-fe:${GITHUB_SHA::8}" >> $GITHUB_OUTPUT | ||
echo "image_tag=ghcr.io/${{ github.repository_owner }}/kemkas-fe:${GITHUB_SHA::8}" >> $GITHUB_OUTPUT | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: ./frontend/ | ||
file: ./frontend/Dockerfile | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: false | ||
load: true | ||
push: true | ||
tags: | | ||
registry.digitalocean.com/kemkas/kemkas-fe:${{ env.GITHUB_SHA_SHORT }} | ||
ghcr.io/${{ github.repository_owner }}/kemkas-frontend:${{ env.GITHUB_SHA_SHORT }} | ||
- name: Push image to Container Registry | ||
run: | | ||
docker push registry.digitalocean.com/kemkas/kemkas-fe:${GITHUB_SHA::8} | ||
docker push ghcr.io/${{ github.repository_owner }}/kemkas-frontend:${GITHUB_SHA::8} | ||
deploy-to-beta: | ||
runs-on: ubuntu-latest | ||
|
@@ -88,4 +75,4 @@ jobs: | |
git config --add user.email "[email protected]" | ||
git config --add user.name "Deployment Bot Beta FE" | ||
git commit -a -m "deploy ${{ needs.docker-fe-build.outputs.image_tag }}" | ||
git push | ||
git push |