Skip to content

Commit

Permalink
Build Github packages in Github action
Browse files Browse the repository at this point in the history
  • Loading branch information
charlie-wasp committed Jun 30, 2020
1 parent 954d742 commit 3c4ae31
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ workflows:
branches:
only:
- master
- elastic

jobs:
build:
Expand All @@ -30,13 +31,10 @@ jobs:
name: Build docker image
command: |
docker build -t astroband/${CIRCLE_PROJECT_REPONAME}:latest -t astroband/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_BRANCH}-${CIRCLE_SHA1} .
docker build -t docker.pkg.github.com/astroband/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_PROJECT_REPONAME}:latest -t docker.pkg.github.com/astroband/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_SHA1} .
# deploy the image
- run:
name: Push image to DockerHub and Github packages
name: Push image to DockerHub
command: |
docker push astroband/${CIRCLE_PROJECT_REPONAME}:latest
docker push astroband/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_BRANCH}-${CIRCLE_SHA1}
docker push docker.pkg.github.com/astroband/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_PROJECT_REPONAME}:latest
docker push docker.pkg.github.com/astroband/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_SHA1}
19 changes: 19 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build Github package
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Login to docker
run: docker login docker.pkg.github.com --username ${{ github.actor }} --password ${{ github.token }}
- name: Build images
run: docker build -t docker.pkg.github.com/${{ github.repository }}/astrograph:${{ github:sha }} -t docker.pkg.github.com/${{ github.repository }}/astrograph:latest .
- name: Push images
run: |
docker push docker.pkg.github.com/${{ github.repository }}/astrograph:${{ github:sha }}
docker push docker.pkg.github.com/${{ github.repository }}/astrograph:latest

0 comments on commit 3c4ae31

Please sign in to comment.