Skip to content

Github Actions use case #11

Github Actions use case

Github Actions use case #11

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. Default is example-site'
required: false
default: 'example-site'
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/checkout@v3
- 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 }}-1 \
-e WEBSITE_EXPIRES=${{ github.event.inputs.website-expires }} \
-e KEEP_RETRIES=${{ github.event.inputs.keep-retries }} \
-e KEEP_HISTORY=${{ github.event.inputs.keep-history }} \
-e GITHUB=true \
-v ${{ github.workspace }}/assets/allure-results:/allure-results \
-v ${{ github.workspace }}/gcp-key.json:/credentials/gcp-key.json \
sokari/allure-docker-deploy:latest