Skip to content

GitHub action to create a Drupal 8+ release artifact

License

Notifications You must be signed in to change notification settings

eaudeweb/drupal-artifact-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Create a Drupal 8+ release

This GitHub action creates a Drupal 8+ release artifact uploaded to be reused for subsequent workflow steps.

Usage

on: [pull_request]
name: Tests and code
jobs:
  qa:
    runs-on: ubuntu-latest
    steps:

      - uses: cristiroma/drupal-release-action@alpha

Environment

  • GITHUB_SHA - It uses this environment variable to compute an artifact filename based on first 7 characters from SHA.

Outputs

Since v1.2:

  • filename - Artifact full archive filename, e.g. release-a0c2b31.tar.gz
  • base - Artifact archive base name, e.g. release-a0c2b31
  • sha7 - Artifact 7-characters SHA , e.g. a0c2b31

Example 1 - Using output from a job to another job, where build creates the artifact archive and deploy downloads the artifact

on: push
jobs:
  build:
    name: "Create release archive"
    runs-on: ubuntu-latest
    outputs:
      filename: ${{ steps.release.outputs.filename }}
      base: ${{ steps.release.outputs.base }}
      sha7: ${{ steps.release.outputs.sha7 }}
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - uses: cristiroma/drupal-install-action@main
      - name: "Build artifact"
        id: release
        uses: cristiroma/drupal-release-action@main

  deploy:
    name: "Deploy release"
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Download artifact
        uses: actions/download-artifact@v3
        with:
          name: ${{ needs.build.outputs.filename }}

Example 2 - Using output from a step to next step

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - uses: cristiroma/drupal-install-action@main
      - name: 'Build artifact'
        id: build
        uses: cristiroma/drupal-release-action@main
      - name: "Copy to server"
        run: |
          scp ${{ steps.build.outputs.filename }} server:${{ steps.build.outputs.filename }}

About

GitHub action to create a Drupal 8+ release artifact

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •