Skip to content

Commit

Permalink
🚀 gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
anngdinh committed Apr 12, 2024
1 parent 4a48ea9 commit d07a2ae
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches: [ "main", "dev" ]

env:
REGISTRY: ghcr.io

jobs:
build-and-push-image:
runs-on: ubuntu-latest
Expand All @@ -27,22 +24,23 @@ jobs:
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5

- name: Log in to the vCR
uses: docker/login-action@v3
with:
images: ${{ env.REGISTRY }}/vngcloud/${{ matrix.image }}
tags: ${{ github.sha }}
registry: vcr.vngcloud.vn
username: ${{ secrets.VCR_USER }}
password: ${{ secrets.VCR_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ steps.meta.outputs.tags }}
ghcr.io/vngcloud/${{ matrix.image }}:${{ github.sha }}
vcr.vngcloud.vn/60108-annd2-ingress/${{ matrix.image }}:${{ github.sha }}
target: ${{ matrix.image }}

0 comments on commit d07a2ae

Please sign in to comment.