Skip to content

add version file and pipeline #1

add version file and pipeline

add version file and pipeline #1

Workflow file for this run

name: Pipeline
on:
push:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
publish-docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: |
VERSION=$(cat VERSION)
docker build . -t ${{ vars.DOCKER_HUB_USERNAME }}/backup:latest
docker build . -t ${{ vars.DOCKER_HUB_USERNAME }}/backup:${VERSION}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Push to Docker Hub
run: |
docker push ${{ vars.DOCKER_HUB_USERNAME }}/myfinance:latest
docker push ${{ vars.DOCKER_HUB_USERNAME }}/myfinance:${VERSION}
env:
username: ${{ vars.DOCKER_HUB_USERNAME }}
publish-dockerhub-description:
if: contains('refs/heads/master', github.ref)
needs:
- publish-docker-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update Dockerhub description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ vars.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
repository: ${{ vars.DOCKER_HUB_USERNAME }}/myfinance
readme-filepath: ./README.md