mirror of https://github.com/ghostfolio/ghostfolio
committed by
GitHub
1 changed files with 29 additions and 10 deletions
@ -1,18 +1,37 @@ |
|||
name: Docker Image CI |
|||
name: Build and Push Docker Image |
|||
|
|||
on: |
|||
push: |
|||
branches: [ "development" ] |
|||
pull_request: |
|||
branches: [ "development" ] |
|||
branches: |
|||
- development |
|||
- master |
|||
|
|||
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: |
|||
- uses: actions/checkout@v3 |
|||
- name: Build the Docker image |
|||
run: docker build . --file Dockerfile --tag roger-ghostfolio:$(date +%s) |
|||
- name: Build Docker image |
|||
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 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…
Reference in new issue