Skip to content

Commit

Permalink
Move from drone to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mitulshah-suse committed Apr 30, 2024
1 parent 749e887 commit 8cb7c6a
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 109 deletions.
109 changes: 0 additions & 109 deletions .drone.yml

This file was deleted.

104 changes: 104 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Workflow for install-docker

on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master

jobs:
validate:
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 10
container:
image: rancher/dapper:v0.6.0
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate
run: dapper validate

test:
permissions:
contents: read
needs: validate
runs-on: ubuntu-latest
timeout-minutes: 90
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

upload-dev:
permissions:
contents: read
id-token: write
needs: [validate, test]
runs-on: ubuntu-latest
timeout-minutes: 10
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"
- 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
upload:
permissions:
contents: read
id-token: write
needs: [validate, test]
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.event_name == 'push' && 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"
- 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
predefinedAcl: publicRead
headers: |-
Cache-Control: public,no-cache,proxy-revalidate
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/bin
*.swp
.idea
# Ignore generated credentials from google-github-actions/auth
gha-creds-*.json

0 comments on commit 8cb7c6a

Please sign in to comment.