Update Images #219
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 is a basic workflow to help you get started with Actions | |
name: Update Images | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "30 10 * * 0" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
update: | |
strategy: | |
matrix: | |
version: [39, 40, 41] | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ matrix.version }} | |
- name: Get the fedora-container-release binary | |
run : | | |
sudo apt-get update | |
sudo apt-get -y install podman | |
podman pull quay.io/cverna/fedora-container-release:latest | |
podman pull quay.io/cverna/download_fedora_container:latest | |
- name: Prepare the repository | |
run: | | |
git checkout -b tmp | |
git branch -D ${{ matrix.version }} | |
git checkout --orphan ${{ matrix.version }} | |
git rm --cached -r . | |
rm -fr ./* | |
- name: Run the release script < 40 | |
if: ${{ matrix.version < 40 }} | |
run: | | |
podman run --rm --workdir /tmp -v $PWD:/tmp:z fedora-container-release:latest ${{ matrix.version }} | |
- name: Run the release script == 40 | |
if: ${{ matrix.version == 40 }} | |
run: | | |
podman run --rm --workdir /tmp -v $PWD:/tmp:z download_fedora_container:latest ${{ matrix.version }} --output-dir /tmp | |
- name: Run the release script == 41 | |
if: ${{ matrix.version == 41 }} | |
run: | | |
podman run --rm --workdir /tmp -v $PWD:/tmp:z download_fedora_container:latest rawhide --output-dir /tmp | |
- name: Delete downloaded archives | |
if: ${{ matrix.version < 40 }} | |
run : | | |
rm -rf *.tar.xz | |
- name: Commit the change | |
run : | | |
git add . | |
git config --local user.email "[email protected]" | |
git config --local user.name "Fedora Container SIG" | |
git commit -a -m "Update Fedora ${{ matrix.version }} - `date --iso-8601`" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ matrix.version }} | |
force: true |