-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add release tag ci pipeline to push to docker hub
- Loading branch information
1 parent
57365ee
commit 125e884
Showing
1 changed file
with
66 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: "Push containers to Docker Hub on release" | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*.*.*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup environment | ||
run: cp .env.example .env | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and push `${{ secrets.DOCKER_BACKEND_CONTAINER_NAME }}` | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./prod.Dockerfile | ||
target: backend | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_BACKEND_CONTAINER_NAME }}:latest | ||
${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_BACKEND_CONTAINER_NAME }}:${{ github.ref_name }} | ||
- name: Build and push `${{ secrets.DOCKER_FRONTEND_CONTAINER_NAME }}` | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./prod.Dockerfile | ||
target: app | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_FRONTEND_CONTAINER_NAME }}:latest | ||
${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_FRONTEND_CONTAINER_NAME }}:${{ github.ref_name }} | ||
- name: Build and push `${{ secrets.DOCKER_SH_ADMIN_CONTAINER_NAME }}` | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./prod.Dockerfile | ||
target: sh_admin | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_SH_ADMIN_CONTAINER_NAME }}:latest | ||
${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_SH_ADMIN_CONTAINER_NAME }}:${{ github.ref_name }} | ||
- name: Build and push `${{ secrets.DOCKER_AIO_CONTAINER_NAME }}` | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./prod.Dockerfile | ||
target: aio | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_AIO_CONTAINER_NAME }}:latest | ||
${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_AIO_CONTAINER_NAME }}:${{ github.ref_name }} |