2023-04-18 09:06:38 -04:00
|
|
|
name: Docker Build and Push
|
|
|
|
|
|
|
|
on:
|
2023-08-15 15:55:38 -04:00
|
|
|
workflow_dispatch:
|
2023-04-18 09:06:38 -04:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-04-18 09:08:34 -04:00
|
|
|
- master
|
2023-04-18 09:06:38 -04:00
|
|
|
|
2023-08-15 15:55:38 -04:00
|
|
|
env:
|
|
|
|
REGISTRY_NAME: ghcr.io
|
|
|
|
IMAGE_NAME: nostr-rs-relay
|
|
|
|
|
2023-04-18 09:06:38 -04:00
|
|
|
jobs:
|
2023-08-15 15:55:38 -04:00
|
|
|
# ci:
|
|
|
|
# name: CI
|
|
|
|
# uses: ./.github/workflows/ci.yml
|
2023-04-26 03:20:31 -04:00
|
|
|
|
2023-04-18 09:06:38 -04:00
|
|
|
build_and_push:
|
2023-08-15 15:55:38 -04:00
|
|
|
# needs: [ci]
|
2023-04-18 09:06:38 -04:00
|
|
|
name: Build and Push
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-08-15 15:55:38 -04:00
|
|
|
- name: Collecting Metadata
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY_NAME }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
|
|
|
|
|
|
|
|
- name: Building And Pushing Image
|
2023-04-18 09:06:38 -04:00
|
|
|
id: docker_build
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
2023-08-15 15:55:38 -04:00
|
|
|
file: ./Dockerfile
|
2023-04-18 09:06:38 -04:00
|
|
|
push: true
|
2023-08-15 15:55:38 -04:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
|
|
|
|
# - name: Build and push
|
|
|
|
# id: docker_build
|
|
|
|
# uses: docker/build-push-action@v4
|
|
|
|
# with:
|
|
|
|
# context: .
|
|
|
|
# push: true
|
|
|
|
# tags: ghcr.io/${{ github.repository_owner }}/nostr-rs-relay:latest
|
2023-04-18 09:06:38 -04:00
|
|
|
|
|
|
|
- name: Image digest
|
|
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|