-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.84 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
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.11
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download Grafana Plugin
run: |
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
ls
unzip -o dfe-azurecostbackend-datasource-${{ env.PLUGIN_VERSION }}.zip
unzip -o blackcowmoo-googleanalytics-datasource-0.2.3.zip
cp /home/runner/work/Grafana.Plugin.CostManagement/Grafana.Plugin.CostManagement/grafana-files/grafana.ini .
cd ..
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-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/grafana-azurecostplugin-grafana:${{ env.PLUGIN_VERSION }}
docker push ghcr.io/dfe-digital/grafana-azurecostplugin-grafana:${{ env.PLUGIN_VERSION }}
env:
DOCKER_BUILDKIT: 1
DOCKER_CLI_ACI: 1