Github Actions use case #16
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
name: Github Actions use case | |
on: | |
workflow_dispatch: | |
inputs: | |
storage-bucket: | |
description: 'Your Firebase (GCP) storage bucket' | |
required: true | |
keep-retries: | |
description: 'Backup results to keep retries' | |
required: false | |
default: 'false' | |
keep-history: | |
description: 'Backup history' | |
required: false | |
default: 'true' | |
website-id: | |
description: 'Unique identifier for the site' | |
required: false | |
website-expires: | |
description: 'Report site expiry. Example: 1h, 2d or 3w. Max is 30d' | |
required: false | |
default: '1h' | |
jobs: | |
generate-publish: | |
runs-on: ubuntu-latest | |
env: | |
GCP_SECRETS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | |
steps: | |
- uses: actions/[email protected] | |
- name: Run Tests | |
run: | | |
echo 'No test to run, using existing assets/allure-results from this repository' | |
- name: Write GCP Credentials | |
run: | | |
echo "$GCP_SECRETS" > ${{ github.workspace }}/gcp-key.json | |
- name: Authenticate Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Deploy Allure Report to Firebase | |
run: | | |
docker run --rm \ | |
-e GOOGLE_APPLICATION_CREDENTIALS=/credentials/gcp-key.json \ | |
-e STORAGE_BUCKET=${{github.event.inputs.storage-bucket}} \ | |
-e WEBSITE_ID=${{ github.event.inputs.website-id }} \ | |
-e WEBSITE_EXPIRES=${{ github.event.inputs.website-expires }} \ | |
-e KEEP_RETRIES=${{ github.event.inputs.keep-retries }} \ | |
-e KEEP_HISTORY=${{ github.event.inputs.keep-history }} \ | |
-v ${{ github.workspace }}/assets/allure-results:/allure-results \ | |
-v ${{ github.workspace }}/gcp-key.json:/credentials/gcp-key.json \ | |
sokari/allure-docker-deploy:latest |