Use ghcr tag directly
This commit is contained in:
parent
fcc72b58ea
commit
bc6e8dd2e0
9
.github/workflows/deploy_api.yml
vendored
9
.github/workflows/deploy_api.yml
vendored
|
|
@ -20,6 +20,9 @@ jobs:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
tag: ${{ steps.meta.outputs.tags[0] }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: docker/login-action@v2
|
- uses: docker/login-action@v2
|
||||||
|
|
@ -39,7 +42,7 @@ jobs:
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: [build-and-push]
|
needs: build-and-push
|
||||||
name: Deploy to EC2
|
name: Deploy to EC2
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
|
@ -51,7 +54,7 @@ jobs:
|
||||||
key: ${{ secrets.EC2_SSH_KEY }}
|
key: ${{ secrets.EC2_SSH_KEY }}
|
||||||
script: |
|
script: |
|
||||||
docker login ${{ env.REGISTRY }} -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
|
docker login ${{ env.REGISTRY }} -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
|
||||||
docker pull ${{ env.REGISTRY }}/${{ github.repository }}/api:main
|
docker pull ${{ needs.build-and-push.outputs.tag }}
|
||||||
docker stop crabfit-api
|
docker stop crabfit-api
|
||||||
docker rm crabfit-api
|
docker rm crabfit-api
|
||||||
docker run -d -p 3000:3000 --name crabfit-api --env-file ./.env ${{ env.REGISTRY }}/${{ github.repository }}/api:main
|
docker run -d -p 3000:3000 --name crabfit-api --env-file ./.env ${{ needs.build-and-push.outputs.tag }}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Crab Fit <img width="100" align="right" src="crabfit-frontend/src/res/logo.svg" alt="avatar">
|
# Crab Fit <img width="100" align="right" src="frontend/src/res/logo.svg" alt="avatar">
|
||||||
|
|
||||||
Align your schedules to find the perfect time that works for everyone.
|
Align your schedules to find the perfect time that works for everyone.
|
||||||
Licensed under the GNU GPLv3.
|
Licensed under the GNU GPLv3.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue