Merge pull request #6 from Y0ngg4n/dependabot/github_actions/dot-gith… #23
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: Push to Dockerhub | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: | |
- master | |
- 'releases/**' | |
jobs: | |
push-to-dockerhub: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- uses: actions/checkout@v2 | |
- name: Write Env File | |
run: | | |
echo "REST_API_URL=$REST_API_URL" >> .env | |
echo "CLIENT_ID=$CLIENT_ID" >> .env | |
echo "CLIENT_SECRET=$CLIENT_SECRET" >> .env | |
echo "CLIENT_ID_WEB=$CLIENT_ID_WEB" >> .env | |
echo "CLIENT_SECRET_WEB=$CLIENT_SECRET_WEB" >> .env | |
env: | |
REST_API_URL: ${{ secrets.ENV_REST_API_URL }} | |
CLIENT_ID: ${{ secrets.ENV_CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.ENV_CLIENT_SECRET }} | |
CLIENT_ID_WEB: ${{ secrets.ENV_CLIENT_ID_WEB }} | |
CLIENT_SECRET_WEB: ${{ secrets.ENV_CLIENT_SECRET_WEB }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./ | |
file: ./web.Dockerfile | |
push: true | |
tags: yonggan/volt_campaigner-web:latest | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |