-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #499 from frontendnetwork/staging
Staging → Main
- Loading branch information
Showing
10 changed files
with
130 additions
and
151 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 |
---|---|---|
|
@@ -6,9 +6,9 @@ name: Create and publish a Docker image | |
on: | ||
push: | ||
branches: | ||
- main | ||
- release | ||
- staging | ||
- main | ||
- release | ||
- staging | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
@@ -22,7 +22,7 @@ jobs: | |
contents: read | ||
packages: write | ||
|
||
environment: | ||
environment: | ||
name: Production | ||
url: https://vegancheck.me | ||
|
||
|
@@ -47,24 +47,43 @@ jobs: | |
run: cp .env.main .env | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@9311bf5263ae5b36f3ec67aff768790c6e2344ad | ||
id: build-prod | ||
uses: docker/build-push-action@fdf7f43ecf7c1a5c7afe936410233728a8c2d9c2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
|
||
deploy-prod: | ||
needs: build-and-push-prod | ||
if: success() && github.ref != 'refs/heads/staging' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: SSH into the server and run Docker Compose | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
script: | | ||
cd vegancheck | ||
docker-compose stop vc-frontend | ||
docker-compose pull vc-frontend | ||
docker-compose up -d vc-frontend | ||
build-and-push-staging: | ||
if: github.ref == 'refs/heads/staging' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
environment: | ||
environment: | ||
name: Staging | ||
url: https://staging.vegancheck.me | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
@@ -83,15 +102,34 @@ jobs: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Setup Staging Env | ||
run: cp .env.development .env | ||
run: cp .env.development .env | ||
|
||
- name: Display .env contents | ||
run: cat .env | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@9311bf5263ae5b36f3ec67aff768790c6e2344ad | ||
id: build-staging | ||
uses: docker/build-push-action@fdf7f43ecf7c1a5c7afe936410233728a8c2d9c2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
deploy-staging: | ||
needs: build-and-push-staging | ||
if: success() && github.ref == 'refs/heads/staging' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: SSH into the server and run Docker Compose | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
script: | | ||
cd vegancheck | ||
docker-compose stop vc-frontend | ||
docker-compose pull vc-frontend | ||
docker-compose up -d vc-frontend |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -19,6 +19,8 @@ | |
.DS_Store | ||
*.pem | ||
.icloud | ||
*.icloud | ||
*/*.icloud | ||
|
||
# debug | ||
npm-debug.log* | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.