Skip to content

Commit

Permalink
Merge pull request #4 from traPtitech/ghcr
Browse files Browse the repository at this point in the history
Goのアップデートとghcrへの移行
  • Loading branch information
sapphi-red authored Jun 22, 2021
2 parents a0105de + 49e9fbf commit c52d3a8
Show file tree
Hide file tree
Showing 3 changed files with 401 additions and 24 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
tags:
- v*

env:
IMAGE_REPO: traptitech/conoha_exporter
IMAGE_NAME: conoha-exporter

jobs:
build:
Expand All @@ -34,13 +31,17 @@ jobs:
- name: Set IMAGE_TAG env
run: echo "IMAGE_TAG=${GITHUB_REF:11}" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Login GitHub Registry
run: docker login docker.pkg.github.com -u traPtitech -p ${{ secrets.GITHUB_TOKEN }}
- name: Build Image
run: docker build -t docker.pkg.github.com/${IMAGE_REPO}/${IMAGE_NAME}:$IMAGE_TAG .
- name: Push image to GitHub Registry
run: docker push docker.pkg.github.com/${IMAGE_REPO}/${IMAGE_NAME}:$IMAGE_TAG
- name: Push image to GitHub Registry (latest)
run: |
docker tag docker.pkg.github.com/${IMAGE_REPO}/${IMAGE_NAME}:$IMAGE_TAG docker.pkg.github.com/${IMAGE_REPO}/${IMAGE_NAME}:latest
docker push docker.pkg.github.com/${IMAGE_REPO}/${IMAGE_NAME}:latest
- name: Login GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: traptitech
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/traptitech/conoha_exporter:${{ env.IMAGE_TAG }}
ghcr.io/traptitech/conoha_exporter:latest
9 changes: 6 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
module github.com/traPtitech/conoha_exporter

go 1.14
go 1.16

require (
github.com/prometheus/client_golang v1.5.0
gopkg.in/yaml.v2 v2.2.5
github.com/golang/protobuf v1.5.2 // indirect
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/common v0.29.0 // indirect
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
gopkg.in/yaml.v2 v2.4.0
)
Loading

0 comments on commit c52d3a8

Please sign in to comment.