name: Docker Build on: push: branches: - main pull_request: branches: - main env: REGISTRY_USER: admin REGISTRY_PASSWORD: 6nkTT9Th5z6gR?ro IMAGE_REGISTRY: hub.docker.xiaohei.one PROJECT_NAME: test-devops IMAGE_TAGS: ${{ gitea.sha }} jobs: build: name: Build and push docker image runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v4 - name: install podman run: apt update && apt install podman -y - uses: redhat-actions/buildah-build@v2 with: image: my-new-image tags: v1 ${{ gitea.sha }} dockerfiles: | ./Dockerfile # - name: Print to Log # id: print-to-log # uses: ./ # with: # who-to-greet: Test # - name: Build Docker Image # run: podman build -t ${{ IMAGE_REGISTRY }}/${{ PROJECT_NAME }}:${{ IMAGE_TAGS }} . # - name: login to registry # run: podman login ${{ IMAGE_REGISTRY }} -u ${{ REGISTRY_USER }} -p ${{ REGISTRY_PASSWORD }} # - name: push to registry # run: podman push ${{ IMAGE_REGISTRY }}/${{ PROJECT_NAME }}:${{ IMAGE_TAGS }}