Skip to content

Commit

Permalink
Migrated to GitHub Container Registry
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Sep 14, 2020
1 parent 8012af1 commit cce14ee
Show file tree
Hide file tree
Showing 5 changed files with 456 additions and 14 deletions.
16 changes: 10 additions & 6 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
container:
image: golang:1.10
image: golang:latest

env:
GOPROXY: https://proxy.golang.org

test_task:
env:
CIRRUS_WORKING_DIR: /go/src/github.com/$CIRRUS_REPO_FULL_NAME
get_script: go get -t -v ./...
vet_script: go vet -v ./...
test_script: go test -v ./...
modules_cache:
fingerprint_script: cat go.sum
folder: $GOPATH/pkg/mod
get_script: go get ./...
build_script: go build ./...
test_script: go test ./...
21 changes: 21 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Push Docker Image

on:
push:
branches:
- master
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker Build
run: docker build --tag ghcr.io/cirruslabs/google-storage-proxy:latest .
- name: Docker Login
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Docker Push
run: docker push ghcr.io/cirruslabs/google-storage-proxy:latest
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
FROM golang:1.10-alpine as builder
FROM golang:latest as builder

RUN apk update && apk upgrade && \
apk add --no-cache git

WORKDIR /go/src/github.com/cirruslabs/google-storage-proxy
ADD . /go/src/github.com/cirruslabs/google-storage-proxy
WORKDIR /build
ADD . /build

RUN go get -t -v ./... && \
go test -v ./... && \
go build -o google-storage-proxy ./cmd/

FROM alpine
FROM alpine:latest
LABEL org.opencontainers.image.source=https://github.com/cirruslabs/google-storage-proxy/

WORKDIR /svc
COPY --from=builder /go/src/github.com/cirruslabs/google-storage-proxy/google-storage-proxy /svc/
COPY --from=builder /build/google-storage-proxy /svc/
ENTRYPOINT ["/svc/google-storage-proxy"]
8 changes: 8 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/cirruslabs/google-storage-proxy

go 1.15

require (
cloud.google.com/go/storage v1.11.0
github.com/fsouza/fake-gcs-server v1.21.0
)
Loading

0 comments on commit cce14ee

Please sign in to comment.