Skip to content

publish

publish #20

Workflow file for this run

name: publish
on:
create:
tags:
- ".+"
workflow_dispatch:
env:
PYTHON_VERSION: 3.x
jobs:
publish:
name: Build and push Docker image
if: github.event.repository.fork == false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Lowercase repository name
run: |
echo "REPOSITORY_NAME=elastic/opencti-connector-vti" >> $GITHUB_ENV
echo "SHORT_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v2
with:
context: .
# platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ env.REPOSITORY_NAME }}:latest
ghcr.io/${{ env.REPOSITORY_NAME }}:${{ env.SHORT_COMMIT }}
- name: Check Docker image
run: docker run --rm -i ghcr.io/${{ env.REPOSITORY_NAME }} --version
- name: Publish Docker image
run: |
docker push --all-tags ghcr.io/${{ env.REPOSITORY_NAME }}