Skip to content

Commit

Permalink
cd: build versioned docker container only on request
Browse files Browse the repository at this point in the history
  • Loading branch information
gion-andri committed Mar 13, 2024
1 parent 0eb98ff commit df595de
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 7 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: Docker Build main

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

workflow_dispatch:
on: [ workflow_dispatch ]

jobs:
build_staging:
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/docker_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Docker Build main

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

workflow_dispatch:

jobs:
build_staging:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- name: docker login
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: docker build
run: |
docker build --build-arg ANGULAR_ENV=staging -t farscrl/chalender-frontend:latest-staging .
- name: docker push
run: |
docker push farscrl/chalender-frontend --all-tags
build_prod:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- name: docker login
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: docker build
run: |
docker build --build-arg ANGULAR_ENV=prod -t farscrl/chalender-frontend:latest-prod .
- name: docker push
run: |
docker push farscrl/chalender-frontend --all-tags

0 comments on commit df595de

Please sign in to comment.