-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 2.07 KB
/
publish-ghcr.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: Build and Push Grafana Docker Image
on:
workflow_dispatch:
release:
types: [published]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
PLUGIN_VERSION: 1.0.12
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download Grafana Plugin
run: |
ls
mkdir -p latest-cost-plugin
cd latest-cost-plugin
wget "https://github.com/DFE-Digital/Grafana.Plugin.CostManagement/releases/download/main/dfe-azurecostbackend-datasource-${{ env.PLUGIN_VERSION }}.zip"
wget "https://grafana.com/api/plugins/blackcowmoo-googleanalytics-datasource/versions/0.2.3/download" -O blackcowmoo-googleanalytics-datasource-0.2.3.zip
wget "https://grafana.com/api/plugins/netsage-sankey-panel/versions/1.1.1/download" -O netsage-sankey-panel-1.1.1.zip
ls
unzip -o dfe-azurecostbackend-datasource-${{ env.PLUGIN_VERSION }}.zip
unzip -o blackcowmoo-googleanalytics-datasource-0.2.3.zip
unzip -o netsage-sankey-panel-1.1.1.zip
cp /home/runner/work/childrens-social-care-cpd-grafana/childrens-social-care-cpd-grafana/grafana-files/grafana.ini .
cd ..
# Login against a Docker registry except on PR
# https://github.com/docker/#-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/#-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image
run: |
docker build . -t ghcr.io/dfe-digital/childrens-social-care-cpd-grafana:${{ env.PLUGIN_VERSION }}
docker push ghcr.io/dfe-digital/childrens-social-care-cpd-grafana:${{ env.PLUGIN_VERSION }}
env:
DOCKER_BUILDKIT: 1
DOCKER_CLI_ACI: 1