forked from rancher/elemental-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from davidcassany/v2.1.x_backport_ci_refactor
V2.1.x backport ci refactor
- Loading branch information
Showing
21 changed files
with
523 additions
and
159 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Pull images | ||
descriptions: Fetches and loads images from the cache | ||
|
||
inputs: | ||
version: | ||
description: key of the cache and tag of the images | ||
required: true | ||
type: string | ||
flavor: | ||
description: flavor of the OS image | ||
required: false | ||
type: string | ||
toolkit: | ||
description: fetch toolkit image | ||
required: false | ||
default: 'true' | ||
type: 'boolean' | ||
os: | ||
description: fetch OS image | ||
required: false | ||
default: 'true' | ||
type: 'boolean' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- if: ${{ inputs.toolkit == 'true' }} | ||
name: Fetch toolkit image | ||
id: cache-toolkit | ||
uses: actions/cache/restore@v4 | ||
env: | ||
cache-name: toolkit-build-x86_64-${{ github.event_name }} | ||
with: | ||
path: /tmp/toolkit.tar | ||
key: ${{ env.cache-name }}-${{ inputs.version }} | ||
fail-on-cache-miss: true | ||
- if: ${{ inputs.toolkit == 'true' }} | ||
name: Load toolkit image | ||
id: load-toolkit | ||
shell: bash | ||
run: | | ||
docker load -i /tmp/toolkit.tar | ||
- if: ${{ inputs.os == 'true' }} | ||
name: Fetch OS image | ||
id: cache-os | ||
uses: actions/cache/restore@v4 | ||
env: | ||
cache-name: os-build-x86_64-${{ inputs.flavor }}-${{ github.event_name }} | ||
with: | ||
path: /tmp/os.tar | ||
key: ${{ env.cache-name }}-${{ inputs.version }} | ||
fail-on-cache-miss: true | ||
- if: ${{ inputs.os == 'true' }} | ||
name: Load OS image | ||
id: load-os | ||
shell: bash | ||
run: | | ||
docker load -i /tmp/os.tar |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Version hash | ||
descriptions: Computes the version hash from the current context | ||
|
||
outputs: | ||
version: | ||
description: computed hash from current context | ||
value: ${{ steps.version.outputs.version }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Define version | ||
id: version | ||
shell: bash | ||
env: | ||
hash: ${{ hashFiles('Dockerfile', '**/go.sum', '**/pkg/**', '**/examples/**', '**/cmd/**', '**/vendor/**', '**/Makefile', '**/main.go') }} | ||
run: | | ||
version="${{ env.hash }}" | ||
version=${version::16} | ||
echo "version=${version}" >> $GITHUB_OUTPUT |
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 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
Oops, something went wrong.