Add sqlite in Docker image #22
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: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Github Packages | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_PAT }} | |
- name: Build the Docker image | |
run: | | |
docker build . --file Dockerfile --tag ghcr.io/openplaceguide/opg-pages:latest | |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
if [ "$CURRENT_BRANCH" = "main" ]; then | |
echo "On the 'main' branch. Pushing the Docker image..." | |
docker push ghcr.io/openplaceguide/opg-pages:latest | |
else | |
echo "Not on the 'main' branch. Skipping Docker push." | |
fi |