Adding on github actions
This commit is contained in:
51
.github/workflows/build.yml
vendored
51
.github/workflows/build.yml
vendored
@@ -34,32 +34,33 @@ jobs:
|
|||||||
login-server: ${{ env.REGISTRY }}
|
login-server: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
# This requires docker buildx which podman doesn't support
|
||||||
id: meta
|
# - name: Extract metadata (tags, labels) for Docker
|
||||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
# id: meta
|
||||||
with:
|
# uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
# with:
|
||||||
- name: Build and push Docker images
|
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
# - name: Build and push Docker images
|
||||||
with:
|
# uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||||
context: .
|
# with:
|
||||||
push: true
|
# context: .
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
# push: true
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
# tags: ${{ steps.meta.outputs.tags }}
|
||||||
# - name: Build the Docker image
|
# labels: ${{ steps.meta.outputs.labels }}
|
||||||
# run: |
|
- name: Build the Docker image
|
||||||
# if [[ "$GITHUB_REF" =~ ^refs/tags.* ]]; then
|
run: |
|
||||||
# VERSION=$GITHUB_REF_NAME
|
if [[ "$GITHUB_REF" =~ ^refs/tags.* ]]; then
|
||||||
# else
|
VERSION=$GITHUB_REF_NAME
|
||||||
# VERSION=$(echo "${GITHUB_REF_NAME}" | sed 's|/|-|g')
|
else
|
||||||
# fi
|
VERSION=$(echo "${GITHUB_REF_NAME}" | sed 's|/|-|g')
|
||||||
# podman build . --file Dockerfile --tag "ghcr.io/$IMAGE_NAME:$VERSION"
|
fi
|
||||||
|
podman build . --file Dockerfile --tag "$REGISTRY/$IMAGE_NAME:$VERSION"
|
||||||
# echo $REG_TOKEN | podman login ghcr.io -u ${GITHUB_ACTOR} --password-stdin
|
# echo $REG_TOKEN | podman login ghcr.io -u ${GITHUB_ACTOR} --password-stdin
|
||||||
# podman push "ghcr.io/$IMAGE_NAME:$VERSION"
|
podman push "$REGISTRY/$IMAGE_NAME:$VERSION"
|
||||||
# if [[ "$GITHUB_REF" =~ ^refs/tags.* ]]; then
|
if [[ "$GITHUB_REF" =~ ^refs/tags.* ]]; then
|
||||||
# podman tag "ghcr.io/$IMAGE_NAME:$VERSION" "$IMAGE_NAME:latest"
|
podman tag "$REGISTRY/$IMAGE_NAME:$VERSION" "$IMAGE_NAME:latest"
|
||||||
# podman push "ghcr.io/$IMAGE_NAME:latest"
|
podman push "$REGISTRY/$IMAGE_NAME:latest"
|
||||||
# fi
|
fi
|
||||||
# env:
|
# env:
|
||||||
# REG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
# REG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# # REG_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
|
# # REG_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user