Skip to content

[UPD] added extended CI and builds; #1

[UPD] added extended CI and builds;

[UPD] added extended CI and builds; #1

name: ci-builds-and-releases
on:
push:
branches:
- main
release:
types:
- created
schedule:
- cron: "0 0 * * *"
jobs:
docker_build:
name: Build and Push Docker Image
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
platforms: linux/amd64,linux/arm64

Check failure on line 22 in .github/workflows/ci-builds-and-releases.yml

View workflow run for this annotation

GitHub Actions / ci-builds-and-releases

Invalid workflow file

The workflow is not valid. .github/workflows/ci-builds-and-releases.yml (Line: 22, Col: 9): Unexpected value 'platforms'
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get short SHA
id: vars
run: echo "SHORT_SHA=${GITHUB_SHA::8}" >> $GITHUB_ENV
- name: Get repo name
id: vars
run: echo "GH_REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
tags: ${{ secrets.DOCKER_USERNAME }}/${{ env.GH_REPO_NAME }}:${{ env.SHORT_SHA }}
push: true
labels: ${{ github.github_repository }}
release:
name: Create GitHub Release
runs-on: ubuntu-20.04
needs: docker_build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get last 4 commits
id: last_commits
run: |
git log -4 --pretty=format:"- %s (%h)" > last_commits.txt
echo "LAST_COMMITS=$(cat last_commits.txt)" >> $GITHUB_ENV
- name: Upload source code to GitHub Release
uses: softprops/action-gh-release@v2
with:
body: ${{ env.LAST_COMMITS }}