Deploy #2
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
name: Deploy | |
on: | |
workflow_run: | |
workflows: ["Node.js CI"] | |
types: [completed] | |
jobs: | |
deploy-if-tests-pass: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to GitHub Packages | |
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build and push Docker image | |
run: | | |
docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }} blog/ | |
docker push ghcr.io/${{ github.repository }}:${{ github.sha }} |