Skip to content

Commit

Permalink
ci: push Containerfile in release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrodicaprio authored Feb 18, 2024
1 parent 63444f7 commit e0e4b0c
Showing 1 changed file with 32 additions and 13 deletions.
45 changes: 32 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ env:

jobs:

release:
generate:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Cache APT packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('**/apt.lock') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Rootfs
run: |
sudo apt install -y debootstrap podman
Expand All @@ -32,15 +40,26 @@ jobs:
- uses: vanilla-os/[email protected]

- name: Commit Containerfile
run: |
mv Containerfile /tmp/Containerfile
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git clean -fxd
git fetch
git checkout release
cp /tmp/Containerfile Containerfile
git add Containerfile
git commit -m "release: ${GITHUB_REF#refs/tags/}"
git push
- name: Save Containerfile
id: save-containerfile
run: echo "::set-output name=file_path::Containerfile"

commit:

runs-on: ubuntu-latest

steps:
- name: Checkout release branch
uses: actions/checkout@v4
with:
ref: 'release'

- name: Commit Containerfile
run: |
file_path="${{ steps.save-containerfile.outputs.file_path }}"
cp $file_path Containerfile
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add Containerfile
git commit -m "release: ${GITHUB_REF#refs/tags/}"
git push

0 comments on commit e0e4b0c

Please sign in to comment.