diff --git a/.gitea/workflows/release-image.yml b/.gitea/workflows/release-image.yml new file mode 100644 index 0000000..bc9350c --- /dev/null +++ b/.gitea/workflows/release-image.yml @@ -0,0 +1,37 @@ +on: [push] + +name: Continuous Releases + +env: + IMAGE_NAME: tea.werats.gay/${{ github.repository }} + UBUNTU_VERSION: latest + VERSION_FRAGMENT: minor + CURRENT_VERSION: 0.0.0 + +jobs: + publish_image: + name: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Read Current Version + run: echo "::set-env name=CURRENT_VERSION::$(cat version.txt)" + - name: Increment Semantic Version + uses: christian-draeger/increment-semantic-version@1.2.3 + id: bump_version + with: + current-version: ${{ env.CURRENT_VERSION }} + version-fragment: ${{ env.VERSION_FRAGMENT }} + - run: echo "${{ steps.bump_version.outputs.next-version }}" > version.txt + - name: Read Current Version + run: echo "::set-env name=CURRENT_VERSION::$(cat version.txt)" + - run: git config --global user.name "Build Pipeline" + - run: git config --global user.email "noreply@example.com" + - run: git add version.txt && git commit -m "${{ env.VERSION_FRAGMENT }} version increment [skip actions]" && git tag ${{ env.CURRENT_VERSION }} + - run: mkdir -p /etc/secrets || true + - run: printf '%s' "${{ secrets.CI_ACCESS }}" > /etc/secrets/docker.txt + - run: docker login --username ${{ env.GITHUB_ACTOR }} --password-stdin tea.werats.gay < /etc/secrets/docker.txt + - run: docker build . -t ${{ env.IMAGE_NAME }}:latest -t ${{ env.IMAGE_NAME }}:${{ env.CURRENT_VERSION}} --build-arg UBUNTU_VERSION=${{ env.UBUNTU_VERSION }} + - run: docker push -a ${{ env.IMAGE_NAME }} && git push && git push --tags \ No newline at end of file diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..8a9ecc2 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.0.1 \ No newline at end of file