Initial commit #1
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: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build Docker image | ||
run: | | ||
docker build -t ghcr.io/${{ github.repository }}/demo-app:${{ github.sha }} . | ||
- name: Push Docker image | ||
run: | | ||
docker push ghcr.io/${{ github.repository }}/demo-app:${{ github.sha }} | ||
- name: Output image tag | ||
run: echo "Image: ghcr.io/${{ github.repository }}/demo-app:${{ github.sha }}" | ||