-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (54 loc) · 2.01 KB
/
actions-example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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