Skip to content

Commit

Permalink
chore: publish to github container registry as well (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi authored Sep 24, 2020
1 parent 9ab3128 commit e225657
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ test
# Non-daemon source code
client
*_test.go
contrib/npm

# Dependencies
bin
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build and publish daemon:latest
- name: Build daemon
run: make daemon-release RELEASE=latest

- name: Publish to Docker Hub
run: |
docker login -u ${{ secrets.docker_user }} -p ${{ secrets.docker_key }}
make daemon-release RELEASE=latest
docker push ubclaunchpad/inertia:latest
- name: Publish to GitHub Container Registry
run: |
echo ${{ secrets.GH_PACKAGES_TOKEN }} | docker login ghcr.io --username $GITHUB_ACTOR --password-stdin
docker tag ubclaunchpad/inertia:latest ghcr.io/ubclaunchpad/inertia:latest
docker push ghcr.io/ubclaunchpad/inertia:latest
14 changes: 12 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-go@v1
with: { go-version: '1.14' }
- name: Build release and publish daemon
- name: Build release
run: |
docker login -u ${{ secrets.docker_user }} -p ${{ secrets.docker_key }}
bash .scripts/release.sh
RELEASE=$(git describe --tags) bash .scripts/release.sh
- name: Publish to Docker Hub
run: |
docker login -u ${{ secrets.docker_user }} -p ${{ secrets.docker_key }}
docker push ubclaunchpad/inertia:$(git describe --tags)
- name: Publish to GitHub Container Registry
run: |
echo ${{ secrets.GH_PACKAGES_TOKEN }} | docker login ghcr.io --username $GITHUB_ACTOR --password-stdin
docker tag ubclaunchpad/inertia:$(git describe --tags) ghcr.io/ubclaunchpad/inertia:$(git describe --tags)
docker push ghcr.io/ubclaunchpad/inertia:$(git describe --tags)
- name: Publish CLI
uses: softprops/action-gh-release@v1
with:
Expand Down
1 change: 0 additions & 1 deletion .scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Specify platforms and release version
PLATFORMS="linux/amd64 linux/386 darwin/amd64 windows/amd64 windows/386"
RELEASE=$(git describe --tags)
echo "Building release $RELEASE"

# Build, tag and push Inertia Docker image
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,11 @@ testenv-clean:
install-tagged:
go install -ldflags "-X $(CLI_VERSION_VAR)=$(TAG)"

## daemon-release: build the daemon and push it to the UBC Launch Pad Docker Hub
## daemon-release: build the daemon as ubclaunchpad/inertia:RELEASE
.PHONY: daemon-release
daemon-release:
docker build --build-arg INERTIA_VERSION=$(RELEASE) \
-t ubclaunchpad/inertia:$(RELEASE) .
docker push ubclaunchpad/inertia:$(RELEASE)

## cli-release: cross-compile Inertia CLI binaries for distribution
.PHONY: cli-release
Expand Down

0 comments on commit e225657

Please sign in to comment.