Skip to content

Instantly share code, notes, and snippets.

@piotrpersona
Created October 6, 2020 18:31
Show Gist options
  • Save piotrpersona/e08a1e88dcb64e2fadf475cd221125b9 to your computer and use it in GitHub Desktop.
Save piotrpersona/e08a1e88dcb64e2fadf475cd221125b9 to your computer and use it in GitHub Desktop.
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Upload docker image
run: |
IMAGE=$GITHUB_REPOSITORY
TAG=$GITHUB_SHA-$GITHUB_RUN_ID
docker build -t $IMAGE:$TAG .
docker push $IMAGE:$TAG
docker tag $IMAGE:$TAG $IMAGE:latest
docker push $IMAGE:latest
BRANCH=$(git rev-parse --abbrev-ref HEAD)
docker tag $IMAGE:$TAG $IMAGE:$BRANCH
docker push $IMAGE:$BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment