Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
TanChongWei authored Jul 13, 2023
1 parent af39331 commit bdac03f
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,59 +18,59 @@ jobs:
- name: Run test
run: npm run test

docker-build-image-synk-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Build docker image
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# docker-build-image-synk-scan:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# # Build docker image
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1

- name: Docker image
run: docker build -t amongustodo/test .
# - name: Docker image
# run: docker build -t amongustodo/test .

#Snyk security scan on docker image
- name: Snyk scan on Docker image
uses: snyk/actions/docker@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
image: amongustodo/test
# #Snyk security scan on docker image
# - name: Snyk scan on Docker image
# uses: snyk/actions/docker@master
# env:
# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
# with:
# image: amongustodo/test

docker-push:
needs: [run-tests, docker-build-image-synk-scan]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker Hub Login
# Dockerhub login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# docker-push:
# needs: [run-tests, docker-build-image-synk-scan]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Docker Hub Login
# # Dockerhub login
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# Dockerhub push
- name: Docker build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/amongus-todo:latest
# # Dockerhub push
# - name: Docker build and push
# id: docker_build
# uses: docker/build-push-action@v2
# with:
# push: true
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/amongus-todo:latest

deploy:
needs: [run-tests, docker-build-image-synk-scan]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# deploy:
# needs: [run-tests, docker-build-image-synk-scan]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2

# Deploy to Heroku
- uses: akhileshns/heroku-deploy@v3.12.12
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: cw-amongus-todo #Must be unique in Heroku
heroku_email: ${{ secrets.HEROKU_EMAIL }}
usedocker: true
# # Deploy to Heroku
# - uses: akhileshns/heroku-deploy@v3.12.12
# with:
# heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
# heroku_app_name: cw-amongus-todo #Must be unique in Heroku
# heroku_email: ${{ secrets.HEROKU_EMAIL }}
# usedocker: true

0 comments on commit bdac03f

Please sign in to comment.