name: Docker on: schedule: - cron: '0 0 * * *' push: branches: - main pull_request: workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry if: github.event_name != 'pull_request' uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image (base) uses: docker/build-push-action@v2 with: context: ./base push: ${{ github.event_name != 'pull_request' }} tags: | medzik/archlinux:latest medzik/archlinux:base ghcr.io/m3dzik/archlinux:latest ghcr.io/m3dzik/archlinux:base - name: Build and push Docker image (base-devel) uses: docker/build-push-action@v2 with: context: ./base-devel push: ${{ github.event_name != 'pull_request' }} tags: | medzik/archlinux:base-devel ghcr.io/m3dzik/archlinux:base-devel