Created
May 12, 2020 14:56
-
-
Save phelewski/339306be760e462093641a2618086955 to your computer and use it in GitHub Desktop.
Visual Studios Code Remote - Container Blog | Example Docker Hub Publishing GitHub Workflow Action
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: VS Code DockerHub Build & Push | |
on: | |
push: | |
branches: | |
- 'master' | |
paths: | |
- '.devcontainer/build/Dockerfile' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: checkout | |
uses: actions/checkout@master | |
- | |
name: docker login | |
env: | |
DOCKER_USER: ${{ secrets.docker_user }} | |
DOCKER_PASSWORD: ${{ secrets.docker_password }} | |
run: | | |
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin | |
- | |
name: Build & Push to DockerHub | |
env: | |
DOCKER_ORG: stelligent | |
DOCKER_REPO: vscode-remote-cfn_nag | |
run: | | |
docker build -t $DOCKER_ORG/$DOCKER_REPO:${GITHUB_SHA::8} --file .devcontainer/build/Dockerfile . | |
docker tag $DOCKER_ORG/$DOCKER_REPO:${GITHUB_SHA::8} $DOCKER_ORG/$DOCKER_REPO:latest | |
docker push $DOCKER_ORG/$DOCKER_REPO:${GITHUB_SHA::8} | |
docker push $DOCKER_ORG/$DOCKER_REPO:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment