@@ -41,35 +41,22 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: docker/setup-buildx-action@v3
|
- 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
|
- name: Log in to GitHub Container Registry
|
||||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
- id: get_image_tag
|
- id: get_image_tag
|
||||||
run: |
|
run: |
|
||||||
echo "GITHUB_SHA_SHORT=$(echo ${GITHUB_SHA::8})" >> $GITHUB_ENV
|
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 "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
|
- uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ./frontend/
|
context: ./frontend/
|
||||||
file: ./frontend/Dockerfile
|
file: ./frontend/Dockerfile
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
push: false
|
push: true
|
||||||
load: true
|
|
||||||
tags: |
|
tags: |
|
||||||
registry.digitalocean.com/kemkas/kemkas-fe:${{ env.GITHUB_SHA_SHORT }}
|
|
||||||
ghcr.io/${{ github.repository_owner }}/kemkas-frontend:${{ 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:
|
deploy-to-beta:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -88,4 +75,4 @@ jobs:
|
|||||||
git config --add user.email "beta-fe-deployment-bot@kemkas.hu"
|
git config --add user.email "beta-fe-deployment-bot@kemkas.hu"
|
||||||
git config --add user.name "Deployment Bot Beta FE"
|
git config --add user.name "Deployment Bot Beta FE"
|
||||||
git commit -a -m "deploy ${{ needs.docker-fe-build.outputs.image_tag }}"
|
git commit -a -m "deploy ${{ needs.docker-fe-build.outputs.image_tag }}"
|
||||||
git push
|
git push
|
||||||
|
|||||||
Reference in New Issue
Block a user