Update docker_build.yaml #6
This file contains hidden or 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
name: Build and Deploy Docker Image | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build-and-deploy: | |
name: Build and Deploy Docker Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
run: | | |
echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
env: | |
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }} | |
- name: Build and tag image | |
run: | | |
docker build -t ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }} | |
- name: Push image | |
run: | | |
docker push ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }} | |
- name: Deployment notification | |
if: success() | |
run: | | |
echo "Docker image has been successfully built and pushed to DockerHub." | |
echo "You can pull the latest image using:" | |
echo "docker pull starcoin/stc-poly-bridge-frontend:latest" |