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: |
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…
Reference in new issue