Skip to content

Commit

Permalink
Merge pull request #57 from OCA-UFCG/refact/update-cicd
Browse files Browse the repository at this point in the history
Refact CI/CD
  • Loading branch information
abraaovalentim authored Jul 2, 2024
2 parents 729d5cb + af1cde1 commit 08cc342
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/deploy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ jobs:
runs-on: oca-self-hosted-runner
steps:
- uses: actions/checkout@v4

- name: Stop existing container
run: sudo docker rm -f ${{ vars.CONTAINER_NAME_BETA }} || true

- name: Remove the old image
run: sudo docker rmi ${{ vars.DOCKER_IMAGE_BETA }}:latest || true

- name: Update docker metadata with the tag
uses: docker/metadata-action@v4
Expand Down Expand Up @@ -47,6 +41,9 @@ jobs:
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN=${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }}
NEXT_PUBLIC_CONTENTFUL_SPACE=${{ secrets.NEXT_PUBLIC_CONTENTFUL_SPACE }}
- name: Stop existing container
run: sudo docker rm -f ${{ vars.CONTAINER_NAME_BETA }} || true

- name: Run new container
run: sudo docker run --name ${{ vars.CONTAINER_NAME_BETA }} -p ${{ vars.HOST_PORT_BETA }}:${{ vars.CONTAINER_PORT }} -d ${{ vars.DOCKER_IMAGE_BETA }}:latest

Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/deploy-oca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Stop existing container
run: sudo docker rm -f ${{ vars.CONTAINER_NAME_PROD }} || true

- name: Remove the old image
run: sudo docker rmi ${{ vars.DOCKER_IMAGE_PROD }}:latest || true

- name: Update docker metadata with the tag
uses: docker/metadata-action@v4
id: meta
Expand Down Expand Up @@ -47,7 +41,10 @@ jobs:
NEXT_PUBLIC_GA_ID=${{ secrets.NEXT_PUBLIC_GA_ID }}
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN=${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }}
NEXT_PUBLIC_CONTENTFUL_SPACE=${{ secrets.NEXT_PUBLIC_CONTENTFUL_SPACE }}
- name: Stop existing container
run: sudo docker rm -f ${{ vars.CONTAINER_NAME_PROD }} || true

- name: Run new container
run: sudo docker run --name ${{ vars.CONTAINER_NAME_PROD }} -p ${{ vars.HOST_PORT_PROD }}:${{ vars.CONTAINER_PORT }} -d ${{ vars.DOCKER_IMAGE_PROD }}:latest

Expand Down

0 comments on commit 08cc342

Please sign in to comment.