Partially working angular 18 #73
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: Pipeline | |
on: [push] | |
jobs: | |
Build_Docker_Image: | |
name: Build Docker Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
with: | |
fetch-depth: 1 | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Docker build | |
run: | | |
cd src/ | |
docker login docker.pkg.github.com -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" | |
docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD" | |
docker build -t docker.pkg.github.com/benfl3713/finance-manager/finance-manager:latest . | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Docker Publish | |
if: github.ref == 'refs/heads/master' | |
run: | | |
docker push docker.pkg.github.com/benfl3713/finance-manager/finance-manager:latest | |
docker tag docker.pkg.github.com/benfl3713/finance-manager/finance-manager:latest $DOCKER_USERNAME/finance-manager | |
docker push $DOCKER_USERNAME/finance-manager | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} |