diff --git a/.gitea/workflows/bump2version.yaml b/.gitea/workflows/bump2version.yaml.disabled similarity index 100% rename from .gitea/workflows/bump2version.yaml rename to .gitea/workflows/bump2version.yaml.disabled diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml new file mode 100644 index 0000000..5b65374 --- /dev/null +++ b/.gitea/workflows/docker-build.yaml @@ -0,0 +1,19 @@ +name: Build and Push Docker Image +run-name: ${{ gitea.actor }} is building and pushing a Docker Image +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Build Docker image + run: | + docker build -t pyrss-website:latest . + + - name: Push Docker image + run: | + docker tag pyrss-website:latest xordk/pyrss-website:latest + docker push xordk/pyrss-website:latest + with: + username: ${{ secrets.DOCKER_PASSWORD }} + password: ${{ secrets.DOCKER_USERNAME }} \ No newline at end of file diff --git a/.gitea/workflows/docker-build.yaml.disabled b/.gitea/workflows/docker-build.yaml.disabled deleted file mode 100644 index 3c2035f..0000000 --- a/.gitea/workflows/docker-build.yaml.disabled +++ /dev/null @@ -1,49 +0,0 @@ -name: Build and Push Docker Image -run-name: ${{ gitea.actor }} is building and pushing a Docker Image -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install bump2version - - - name: Set up git user - run: | - git config --global user.email "${{ secrets.GIT_EMAIL }}" - git config --global user.name "${{ secrets.GIT_USERNAME }}" - - - name: Bump version - id: bump_version - run: | - bump2version patch - NEW_VERSION=$(git describe --tags) - echo ${NEW_VERSION} - echo "NEW_VERSION=${NEW_VERSION}" > new_version.txt - - - name: Build Docker image - run: | - NEW_VERSION=$(cat new_version.txt) - docker build -t pyrss-website:${{ NEW_VERSION }} . - - - name: Push Docker image - run: | - NEW_VERSION=$(cat new_version.txt) - docker tag pyrss-website:${{ NEW_VERSION }} xordk/pyrss-website:${{ NEW_VERSION }} - docker push xordk/pyrss-website:${{ NEW_VERSION }} - rm new_version.txt - - env: - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} \ No newline at end of file