-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
749e887
commit 43c92c9
Showing
3 changed files
with
118 additions
and
109 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,116 @@ | ||
name: Workflow for install-docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
create: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
validate: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
container: | ||
image: rancher/dapper:v0.6.0 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Validate | ||
run: dapper validate | ||
|
||
test: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
container: | ||
image: rancher/dapper:v0.6.0 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Test | ||
run: dapper test | ||
|
||
add-commit-to-version-file: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Add commit to version file | ||
run: | | ||
echo "{\"version\": \"${{ github.sha }}\"}" > dist/VERSION" | ||
upload-dev: | ||
permissions: | ||
contents: read | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Retrieve Google auth from vault | ||
uses: rancher-eio/read-vault-secrets@main | ||
with: | ||
secrets: | | ||
secret/data/github/repo/${{ github.repository }}/google-auth/rancher/credentials | GOOGLE_AUTH | ||
- name: Authenticate with Google Cloud | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
credentials_json: '${{ env.GOOGLE_AUTH }}' | ||
- name: Upload to Google Cloud Storage | ||
uses: google-github-actions/upload-cloud-storage@v2 | ||
with: | ||
path: dist/ | ||
destination: releases.rancher.com/install-docker-dev | ||
predefinedAcl: publicRead | ||
headers: |- | ||
Cache-Control: public,no-cache,proxy-revalidate | ||
add-tag-to-version-file: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'create' && github.ref_type == 'tag' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Add tag to version file | ||
run: | | ||
echo "{\"version\": \"${{ github.ref_name }}\"}" > dist/VERSION" | ||
upload: | ||
permissions: | ||
contents: read | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'create' && github.ref_type == 'tag' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Retrieve Google auth from vault | ||
uses: rancher-eio/read-vault-secrets@main | ||
with: | ||
secrets: | | ||
secret/data/github/repo/${{ github.repository }}/google-auth/rancher/credentials | GOOGLE_AUTH | ||
- name: Authenticate with Google Cloud | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
credentials_json: '${{ secrets.GOOGLE_AUTH }}' | ||
- name: Upload to Google Cloud Storage | ||
uses: google-github-actions/upload-cloud-storage@v2 | ||
with: | ||
path: dist/ | ||
destination: releases.rancher.com/install-docker | ||
predefinedAcl: publicRead | ||
headers: |- | ||
Cache-Control: public,no-cache,proxy-revalidate |
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 |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
/bin | ||
*.swp | ||
.idea | ||
# Ignore generated credentials from google-github-actions/auth | ||
gha-creds-*.json |