forked from dmwm/CMSMonitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
237 additions
and
32 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Ref: https://githubhttps://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/.com/dmwm/dbs2go/blob/master/.github/workflows/build.yml | ||
|
||
name: Build grafana backup | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'gb-*.*.*' | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.20 | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get git tag | ||
id: get_tag | ||
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//} | ||
|
||
- name: Build grafana-backup image | ||
run: | | ||
echo Image tag: ${{ steps.get_tag.outputs.tag }} | ||
curl -ksLO https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/docker/grafana-backup/Dockerfile | ||
sed -i -e "s,ENV CMSMON_TAG=.*,ENV CMSMON_TAG=${{steps.get_tag.outputs.tag}},g" Dockerfile | ||
docker build . --tag docker.pkg.github.com/dmwm/grafana-backup/grafana-backup | ||
docker tag docker.pkg.github.com/dmwm/grafana-backup/grafana-backup registry.cern.ch/cmsmonitoring/grafana-backup | ||
- name: Login to registry.cern.ch | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: registry.cern.ch | ||
username: ${{ secrets.CERN_LOGIN }} | ||
password: ${{ secrets.CERN_TOKEN }} | ||
|
||
- name: Publish grafana-backup image to registry.cern.ch | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ secrets.CERN_LOGIN }} | ||
password: ${{ secrets.CERN_TOKEN }} | ||
registry: registry.cern.ch | ||
repository: cmsmonitoring/grafana-backup | ||
tag_with_ref: true |
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
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