Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
Luxshan2000 committed Sep 28, 2023
1 parent 90918a8 commit 2ccdfea
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: CICD
name: CICD Frontend

on:
push:
branches: [main]

jobs:
build-frontend:
runs-on: self-hosted
build:
runs-on: [ubuntu-latest]
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand All @@ -16,17 +16,19 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build docker image
run: docker build -t luxshan/aws-pipeline ./frontend
run: docker build -t luxshan/aws-pipeline/frontend ./frontend
- name: Publish image to docker hub
run: docker push luxshan/aws-pipeline:latest
run: docker push luxshan/aws-pipeline/frontend



deploy:
needs: build
runs-on: [aws-ec2]
steps:
- name: Pull image from docker hub
run: docker pull luxshan/aws-pipeline
run: docker pull luxshan/aws-pipeline/frontend:latest
- name: Delete old container
run: docker rm -f aws-pipeline-container
run: docker rm -f aws-pipeline-frontend-container
- name: Run docker container
run: docker run -d -p 3000:3000 --name aws-pipeline-container luxshan/aws-pipeline
run: docker run -d -p 3000:3000 --name aws-pipeline-frontend-container luxshan/aws-pipeline/frontend

0 comments on commit 2ccdfea

Please sign in to comment.