Browse Source

Update docker-image.yml

pull/3382/head
Roger Raventós Calle 2 years ago
committed by GitHub
parent
commit
8980b3dab8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 39
      .github/workflows/docker-image.yml

39
.github/workflows/docker-image.yml

@ -1,18 +1,37 @@
name: Docker Image CI name: Build and Push Docker Image
on: on:
push: push:
branches: [ "development" ] branches:
pull_request: - development
branches: [ "development" ] - master
jobs: jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check Out Repository
uses: actions/checkout@v2
build: - name: Build Project
run: |
npm install
npm run build
runs-on: ubuntu-latest - name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
steps: - name: Build Docker image
- uses: actions/checkout@v3 run: |
- name: Build the Docker image REPO_LOWER=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
run: docker build . --file Dockerfile --tag roger-ghostfolio:$(date +%s) BRANCH_NAME=$(echo ${{ github.ref_name }} | tr '[:upper:]' '[:lower:]') # Get the branch name in lowercase
docker build . -t ghcr.io/$REPO_LOWER/portfolio:$BRANCH_NAME
- name: Push Docker image to GitHub Packages
run: |
REPO_LOWER=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
BRANCH_NAME=$(echo ${{ github.ref_name }} | tr '[:upper:]' '[:lower:]') # Get the branch name in lowercase
docker push ghcr.io/$REPO_LOWER/$REPO_LOWER:$BRANCH_NAME

Loading…
Cancel
Save