Created two new workflows for GH Actions #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
# This workflow runs any time a change is merged into the `main` branch of your | |
# repository. It builds the container image, then pushes it to GitHub Packages. | |
name: Build and Publish | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and push image | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v2 | |
- name: Build image | |
run: | | |
cd sources | |
podman build -t photo-album . | |
# GitHub Packages struggles with the capitals in the UCBoulder org name | |
- name: Downcase repo path | |
run: | | |
echo "REPO=ghcr.io/${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
- name: Push image to GH packages | |
run: | | |
podman login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} | |
podman push photo-album ${{ env.REPO }}/photo-album:latest |