summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-10 11:29:03 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-10 11:29:03 +0200
commit2b9f74282b83e65c870cb9f16381978c390a08b1 (patch)
tree31d5e758fc0c784c18438fe0ad2022dc38cda8c3 /.github
parent471118088109636592471b706ecc38d2eba919f2 (diff)
ci: Support pushing images with docker/build-push-action@v2
This change updates the publish workflow to support pushing images with the new docker/build-push-action version.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/publish.yml60
1 files changed, 51 insertions, 9 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index cabebbd8..bb0f1df6 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -11,38 +11,80 @@ jobs:
steps:
- name: Check out the repo
uses: actions/checkout@v2
- - name: Push to Docker Hub
- uses: docker/build-push-action@v2
+ - name: Prepare
+ id: prep
+ run: |
+ DOCKER_IMAGE=atlargeresearch/opendc
+ VERSION=edge
+ if [[ $GITHUB_REF == refs/tags/* ]]; then
+ VERSION=${GITHUB_REF#refs/tags/}
+ fi
+ TAGS="${DOCKER_IMAGE}:${VERSION}"
+ echo ::set-output name=tags::${TAGS}
+ - name: Login to DockerHub
+ uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - name: Push to Docker Hub
+ uses: docker/build-push-action@v2
+ with:
+ push: true
repository: atlargeresearch/opendc
- tag_with_ref: true
+ tags: ${{ steps.prep.outputs.tags }}
push-api:
name: Push API
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
+ - name: Prepare
+ id: prep
+ run: |
+ DOCKER_IMAGE=atlargeresearch/opendc-web-api
+ VERSION=edge
+ if [[ $GITHUB_REF == refs/tags/* ]]; then
+ VERSION=${GITHUB_REF#refs/tags/}
+ fi
+ TAGS="${DOCKER_IMAGE}:${VERSION}"
+ echo ::set-output name=tags::${TAGS}
+ - name: Login to DockerHub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
+ push: true
context: opendc-web/opendc-web-api
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: atlargeresearch/opendc-web-api
- tag_with_ref: true
+ tags: ${{ steps.prep.outputs.tags }}
push-ui:
name: Push UI
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
+ - name: Prepare
+ id: prep
+ run: |
+ DOCKER_IMAGE=atlargeresearch/opendc-web-ui
+ VERSION=edge
+ if [[ $GITHUB_REF == refs/tags/* ]]; then
+ VERSION=${GITHUB_REF#refs/tags/}
+ fi
+ TAGS="${DOCKER_IMAGE}:${VERSION}"
+ echo ::set-output name=tags::${TAGS}
+ - name: Login to DockerHub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
+ push: true
context: opendc-web/opendc-web-ui
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: atlargeresearch/opendc-web-ui
- tag_with_ref: true
+ tags: ${{ steps.prep.outputs.tags }}