v3.0.4 #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: [master] | |
paths: | |
- .devcontainer/base.Dockerfile | |
- .devcontainer/Dockerfile | |
pull_request: | |
branches: [master] | |
paths: | |
- .devcontainer/base.Dockerfile | |
- .devcontainer/Dockerfile | |
release: | |
types: [published, edited] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set env for PR branch | |
id: branch_vars | |
if: ${{ startsWith(github.ref, 'refs/pull/') }} | |
run: | | |
echo "image_tag=dev" >> $GITHUB_ENV | |
echo "meteor_release=latest" >> $GITHUB_ENV | |
- name: Set env for master branch | |
id: master_vars | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: | | |
echo "image_tag=latest" >> $GITHUB_ENV | |
echo "meteor_release=latest" >> $GITHUB_ENV | |
- name: Set env for github release | |
id: release_vars | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
VERSION=$(echo $GITHUB_REF | sed "s/refs\/tags\/v\(.*\)/\1/") | |
echo "image_tag=$VERSION" >> $GITHUB_ENV | |
echo "meteor_release=$VERSION" >> $GITHUB_ENV | |
- name: Build docker image | |
run: docker build .devcontainer --file .devcontainer/base.Dockerfile --build-arg RELEASE="${{ env.meteor_release }}" --tag "meteorengineer/meteor-devcontainer:${{ env.image_tag }}" | |
- name: Push docker image | |
run: docker push "meteorengineer/meteor-devcontainer:${{ env.image_tag }}" |