Build vagrant images #11
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: Build vagrant images | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'src/Containerfile' | |
pull_request: | |
paths: | |
- 'src/Containerfile' | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1 * * 0' | |
jobs: | |
vagrant: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Build image | |
run: | | |
sudo -E XDG_RUNTIME_DIR= podman build --file "src/Containerfile" --target=vagrant --tag "localhost/vagrant:latest" ./src | |
- name: Publish image | |
if: github.event_name != 'pull_request' | |
env: | |
CREDENTIALS: ${{ secrets.QUAY_IO_CREDENTIALS }} | |
run: | | |
authfile=`mktemp` | |
trap "rm -f '$authfile' || :" EXIT | |
sudo echo -e "$CREDENTIALS" > "$authfile" | |
sudo REGISTRY_AUTH_FILE="$authfile" podman push "localhost/vagrant:latest" "quay.io/sssd/vagrant:latest" |