nvim/.github/workflows/docker-image.yml

29 lines
684 B
YAML
Raw Normal View History

2023-03-03 20:09:40 +00:00
name: Docker Image CI
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
2023-03-03 20:38:49 +00:00
permissions:
packages: write
contents: read
2023-03-03 20:09:40 +00:00
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
2023-03-03 20:46:38 +00:00
run: docker build . --file Dockerfile --tag nvim:latest
2023-03-03 20:38:49 +00:00
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push image
run: |
2023-03-03 20:46:38 +00:00
IMAGE_NAME="nvim"
2023-03-03 20:38:49 +00:00
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
TAG=$(date +"%Y-%m-%dT%H-%M")
2023-03-03 20:46:38 +00:00
docker tag $IMAGE_NAME:latest $IMAGE_ID:$TAG
2023-03-03 20:38:49 +00:00
docker push $IMAGE_ID:$TAG